Merge pull request #6 from sine-fdn/dependabot/cargo/serde_json-1.0.132 #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push] | |
name: iLEAP Demo API CI & CD | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
jobs: | |
build_and_test: | |
name: Rust project | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache target | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: CI | |
working-directory: demo-api | |
run: | | |
make ci | |
cargo clippy -- -Dwarnings | |
deploy_preview: | |
needs: build_and_test | |
if: github.ref == 'refs/heads/preview' | |
name: Deploy preview app | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: flyctl deploy --remote-only --config demo-api/fly.staging.toml | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_PREVIEW_TOKEN }} | |
deploy: | |
needs: build_and_test | |
if: github.ref == 'refs/heads/main' | |
name: Deploy app | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: flyctl deploy --remote-only --config demo-api/fly.production.toml | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |