rewrite readmes and fix docker compose #7
This file contains hidden or 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 to Heroku | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "backend/**" | |
| - ".github/workflows/deploy-backend.yml" | |
| jobs: | |
| deploy-backend: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Detect backend changes | |
| id: changes | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| token: ${{ github.token }} | |
| filters: | | |
| backend: | |
| - 'backend/Dockerfile' | |
| - 'backend/Cargo.toml' | |
| - 'backend/Cargo.lock' | |
| - 'backend/src/**' | |
| - 'backend/migrations/**' | |
| - 'backend/rustfmt.toml' | |
| - name: Install Heroku CLI | |
| run: | | |
| curl https://cli-assets.heroku.com/install.sh | sh | |
| if: steps.changes.outputs.backend == 'true' | |
| - name: Heroku Container Registry login | |
| env: | |
| HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }} | |
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
| run: | | |
| echo "$HEROKU_API_KEY" | docker login -u "$HEROKU_EMAIL" --password-stdin registry.heroku.com | |
| if: steps.changes.outputs.backend == 'true' | |
| - name: Build and push (linux/amd64) | |
| env: | |
| HEROKU_BACKEND_APP: ${{ secrets.HEROKU_BACKEND_APP }} | |
| run: | | |
| DOCKER_BUILDKIT=0 docker build \ | |
| --platform linux/amd64 \ | |
| --target production \ | |
| -t registry.heroku.com/${HEROKU_BACKEND_APP}/web \ | |
| -f backend/Dockerfile backend | |
| docker push registry.heroku.com/${HEROKU_BACKEND_APP}/web | |
| if: steps.changes.outputs.backend == 'true' | |
| - name: Release on Heroku | |
| env: | |
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
| HEROKU_BACKEND_APP: ${{ secrets.HEROKU_BACKEND_APP }} | |
| run: | | |
| heroku container:release web -a "${HEROKU_BACKEND_APP}" | |
| if: steps.changes.outputs.backend == 'true' |