Skip to content

ft: add automated deploy job #38

ft: add automated deploy job

ft: add automated deploy job #38

Workflow file for this run

name: CD
on:
push:
branches:
- main
tags:
- v*
jobs:
push-backend:
name: Build backend
uses: ./.github/workflows/build-push-gcloud.yaml

Check failure on line 13 in .github/workflows/cd-build.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/cd-build.yaml

Invalid workflow file

error parsing called workflow ".github/workflows/cd-build.yaml" -> "./.github/workflows/build-push-gcloud.yaml" (source branch with sha:ac9f68f7e898864127c983ad0f0239e85f2131f4) : You have an error in your yaml syntax on line 76
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]
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=$BACKEND_IMAGE
cd ../frontend
kustomize edit set image frontend=$FRONTEND_IMAGE
# Commit the changes
git add -u
sha_short=$(git rev-parse --short HEAD)
git commit -m "cd: Update image to main-$sha_short"
git push
env:
BACKEND_IMAGE: ${{ needs.push-backend.outputs.full_tag }}
FRONTEND_IMAGE: ${{ needs.push-frontend.outputs.full_tag }}