Fix docker push commands #77
Workflow file for this run
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: Continuous Integration | |
on: | |
push: | |
paths-ignore: | |
- "diagrams/*" | |
- "**/README.md" | |
pull_request: | |
paths-ignore: | |
- "diagrams/*" | |
- "**/README.md" | |
jobs: | |
build: | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Build test Docker image | |
run: docker build --target test --tag backend:test ./backend | |
- name: Run tests | |
run: docker run --env-file backend/.env.test backend:test | |
publish: | |
name: Publish To Docker | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ (github.ref == 'refs/heads/continuous-deployment-to-azure') && (github.event_name == 'push') }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
- name: Build frontend Docker image | |
working-directory: frontend | |
run: docker build --target development --tag frontend:${{ github.sha }} . | |
- name: Push frontend Docker image | |
working-directory: frontend | |
run: docker push calpin/playlist-manager-frontend:${{ github.sha }} | |
- name: Build backend Docker image | |
working-directory: backend | |
run: docker build --target development --tag backend:${{ github.sha }} . | |
- name: Push backend Docker image | |
working-directory: backend | |
run: docker push calpin/playlist-manager-backend:${{ github.sha }} | |
deploy: | |
name: Deploy to Azure | |
runs-on: ubuntu-latest | |
needs: publish | |
if: ${{ (github.ref == 'refs/heads/continuous-deployment-to-azure') && (github.event_name == 'push') }} | |
steps: | |
- name: Trigger Azure frontend deployment webhook | |
run: curl -dH -X POST '${{ secrets.AZURE_DEPLOYMENT_WEBHOOK_FRONTEND }}' | |
- name: Trigger Azure backend deployment webhook | |
run: curl -dH -X POST '${{ secrets.AZURE_DEPLOYMENT_WEBHOOK_BACKEND }}' | |