Fix API build including test files #57
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 API | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - packages/db/** | |
| - apps/api/** | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push the Docker image | |
| uses: docker/build-push-action@v3 | |
| with: | |
| push: true | |
| file: apps/api/Dockerfile | |
| tags: | | |
| ghcr.io/blakesmods/api:latest | |
| ghcr.io/blakesmods/api:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| steps: | |
| - name: Trigger Deployment | |
| run: | | |
| curl --request GET '${{ secrets.INFRASTRUCTURE_WEBHOOK_API }}' --header 'Authorization: Bearer ${{ secrets.INFRASTRUCTURE_TOKEN }}' |