Skip to content

Commit

Permalink
ci: try reusing workflows instead
Browse files Browse the repository at this point in the history
  • Loading branch information
c-git committed Dec 23, 2024
1 parent 36b4344 commit ed5bbaa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 44 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ concurrency:
on:
push:
branches:
- main
- develop
pull_request:
types: [ opened, synchronize, reopened ]
branches:
- develop
workflow_call:

env:
CARGO_TERM_COLOR: always
SQLX_VERSION: 0.8.2 # When changing ensure the cache is invalidated
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/release.yml

This file was deleted.

23 changes: 12 additions & 11 deletions .github/workflows/shuttle.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
name: Shuttle Deploy

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-shuttle-deploy
cancel-in-progress: true

on:
workflow_run:
workflows: [Release Build Confirmation]
types: [completed]
push:
branches:
- main


env:
CARGO_TERM_COLOR: always

jobs:
# https://docs.github.com/en/actions/sharing-automations/reusing-workflows#calling-a-reusable-workflow
run_tests:
uses: ./.github/workflows/general.yml
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
needs: run_tests
steps:
- uses: wykies/checkout@main
- uses: wykies/setup-rust-toolchain@main
Expand All @@ -29,10 +36,4 @@ jobs:
- uses: shuttle-hq/deploy-action@v2
with:
shuttle-api-key: ${{ secrets.SHUTTLE_API_KEY }}
project-id: ${{ secrets.SHUTTLE_PROJ_ID }}
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.ref == 'refs/heads/main' }}
steps:
- run: echo 'The triggering workflow failed. Not deployed!!!'
- run: exit 1
project-id: ${{ secrets.SHUTTLE_PROJ_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/verify_shuttle_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Load sqlx query files for shuttle version
run: cargo run --bin switch-db -- --no-edit-only-copy shuttle
- name: Linting
run: cargo clippy --package chat-app-server --no-default-features --features shuttle -- -D warnings
run: cargo clippy --package chat-app-server --release --no-default-features --features shuttle -- -D warnings

0 comments on commit ed5bbaa

Please sign in to comment.