Skip to content

Update build-backend.yml #2

Update build-backend.yml

Update build-backend.yml #2

Workflow file for this run

name: Build Backend
on:
push:
branches: [ "main" ]
env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GAR_LOCATION: us-central1
jobs:
setup-build-publish:
name: Setup, Build, Publish
runs-on: ubuntu-latest
environment: production
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v4
# Authentication via credentials json
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: Docker configuration
run: gcloud auth configure-docker ${{ env.GAR_LOCATION }}-docker.pkg.dev --quiet
- name: Set up Taskfile
uses: arduino/setup-task@v1.0.3
- name: Build
run: task build-backend-image tag="$GITHUB_SHA"
# Push the Docker image to Google Artifact Registry
- name: Publish
run: task push-backend-image tag="$GITHUB_SHA"