ft: update credits #41
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: CD | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
jobs: | |
push-backend: | |
name: Build backend | |
uses: ./.github/workflows/build-push-gcloud.yaml | |
with: | |
repo: services/whisper-notes-backend | |
dockerfile: backend.Dockerfile | |
registry: europe-north1-docker.pkg.dev | |
secrets: inherit | |
push-frontend: | |
name: Build frontend | |
uses: ./.github/workflows/build-push-gcloud.yaml | |
with: | |
repo: services/whisper-notes-frontend | |
dockerfile: frontend.Dockerfile | |
registry: europe-north1-docker.pkg.dev | |
# CHANGEME: Backend URL to use during frontend build | |
build_args: | | |
VITE_GRPC_BACKEND=https://whisper-notes.shivanshs9.me/api | |
secrets: inherit | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: [push-backend, push-frontend] | |
# CHANGEMEL Change to true to enable the auto-deployment job | |
if: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: fregante/setup-git-user@v2 | |
- name: "Update Deployment Image Tag" | |
working-directory: "iac/services" | |
run: | | |
# Write the new image tags to the kustomization files | |
cd backend | |
kustomize edit set image grpc-backend=$REGISTRY/$GCP_PROJECT/services/whisper-notes-backend:$IMAGE_TAG | |
cd ../frontend | |
kustomize edit set image frontend=$REGISTRY/$GCP_PROJECT/services/whisper-notes-frontend:$IMAGE_TAG | |
# Commit the changes | |
git add -u | |
sha_short=$(git rev-parse --short HEAD) | |
git commit -m "cd: Update image to $sha_short" | |
git push | |
env: | |
REGISTRY: europe-north1-docker.pkg.dev | |
GCP_PROJECT: ${{ secrets.GCLOUD_PROJECT }} | |
IMAGE_TAG: ${{ needs.push-backend.outputs.tag }} |