Feature: Added volume persistence for models #50
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
name: CI/CD | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
backend-ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install latest stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Install just | |
run: | | |
# Update nix | |
nix-channel --add https://nixos.org/channels/nixpkgs-unstable | |
nix-channel --update | |
nix-env -iA nixpkgs.just | |
nix-env -iA nixpkgs.xmlstarlet | |
nix-env -iA nixpkgs.cargo-tarpaulin | |
- name: Lint code | |
run: just lint | |
working-directory: ./apps/backend/backend-server | |
env: | |
CARGO_TERM_COLOR: always | |
- name: Calculate test coverage | |
working-directory: ./apps/backend/backend-server | |
run: | | |
cargo tarpaulin --out Xml | |
COVERAGE=$(cat cobertura.xml | xmlstarlet sel -t -v "/coverage/@line-rate" | awk '{printf "%.2f", $1 * 100}')% | |
echo "COVERAGE=$COVERAGE" >> $GITHUB_ENV | |
env: | |
CARGO_TERM_COLOR: always | |
frontend-ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm install | |
working-directory: ./apps/frontend | |
- name: Build | |
run: npm run build | |
working-directory: ./apps/frontend | |
deploy: | |
runs-on: ubuntu-latest | |
needs: | |
- backend-ci | |
- frontend-ci | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: Deploy | |
if: github.ref == 'refs/heads/main' | |
run: flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |