新增更多日誌 #2
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: Deploy Backend | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/deploy-backend.yml' | |
- 'Cargo.lock' | |
- 'Cargo.toml' | |
- 'scripts/ci/build_docker.sh' | |
- 'src/backend/**' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v22 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Install 🚧 | |
run: | | |
touch ./is-ci-rust | |
nix develop path:$(pwd) -c rustup install stable | |
- name: Check 🔧 | |
run: | | |
nix develop path:$(pwd) -c bash -c 'cargo clippy --release' | |
- name: Build and publish docker image | |
run: | | |
nix develop path:$(pwd) -c bash -c scripts/ci/build_docker.sh |