Skip to content

Commit

Permalink
Create build-backend.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowtham1729 authored Nov 3, 2023
1 parent 36023dd commit 3634e29
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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: |-
echo ${{steps.auth.outputs.access_token}} | docker login -u oauth2accesstoken --password-stdin https://$GAR_LOCATION-docker.pkg.dev
- 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"

0 comments on commit 3634e29

Please sign in to comment.