(feat): dynamic chicklets #511
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: Build & Push Docker Image to Artifact Registry | |
| on: | |
| push: | |
| branches: | |
| - release | |
| permissions: | |
| id-token: write | |
| contents: read | |
| concurrency: | |
| group: docker-publish-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@v1 | |
| with: | |
| workload_identity_provider: projects/840384202515/locations/global/workloadIdentityPools/github-pool/providers/github-provider | |
| service_account: github-deployer@breeze-automatic-prod.iam.gserviceaccount.com | |
| - name: Configure Docker for Artifact Registry | |
| run: | | |
| gcloud auth configure-docker asia-south1-docker.pkg.dev --quiet | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Extract short SHA | |
| run: echo "SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV | |
| - name: Get GCP Access Token for Docker Build | |
| run: | | |
| ACCESS_TOKEN=$(gcloud auth print-access-token) | |
| echo "GCP_ACCESS_TOKEN=$ACCESS_TOKEN" >> $GITHUB_ENV | |
| - name: Build and Push Docker Image to Artifact Registry | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64 | |
| tags: asia-south1-docker.pkg.dev/breeze-automatic-prod/clairvoyance/clairvoyance:${{ env.SHORT_SHA }} | |
| build-args: | | |
| KRISP_BUCKET_PATH=gs://breeze-clairvoyance-models/krisp | |
| AIC_BUCKET_PATH=gs://breeze-clairvoyance-models/aic | |
| secrets: | | |
| gcp_token=${{ env.GCP_ACCESS_TOKEN }} | |
| provenance: false | |
| sbom: false | |
| # ================================================================= | |
| # AUTOMATED BETA DEPLOYMENT | |
| # ================================================================= | |
| - name: Get GKE Credentials | |
| uses: google-github-actions/get-gke-credentials@v3 | |
| with: | |
| cluster_name: breeze-automatic-mum-01 | |
| location: asia-south1 | |
| project_id: breeze-automatic-prod | |
| use_dns_based_endpoint: true | |
| - name: Deploy to GKE Beta Namespace | |
| run: | | |
| echo "🚀 Updating beta deployment to tag: ${{ env.SHORT_SHA }}" | |
| # 3. Seamlessly switch the deployment container image over to the fresh git commit hash | |
| kubectl set image deployment/clairvoyance-beta \ | |
| clairvoyance-sha256-1=asia-south1-docker.pkg.dev/breeze-automatic-prod/clairvoyance/clairvoyance:${{ env.SHORT_SHA }} \ | |
| -n beta | |
| # 4. Watch the deployment update progress live to ensure a healthy rolling update | |
| kubectl rollout status deployment/clairvoyance-beta -n beta --timeout=5m | |
| echo "🎉 Automated deployment to beta namespace completed successfully!" |