Skip to content

fest : update cicd

fest : update cicd #4

Workflow file for this run

name: wheretobin-cicd
on:
push:
branches: [main]
pull_request:
env:
REGION: asia-southeast1
jobs:
# ==============
# CI task
# ==============
build-and-push-image:
environment: dev
name: Build Docker image and push to repositories
runs-on: ubuntu-latest
strategy:
matrix:
module:
[
backend,
frontend
]
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.SERVICE_ACCOUNT_KEY }}"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"
- name: "Use gcloud CLI"
run: "gcloud info"
- name: "Docker auth"
run: |-
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
- name: Build image
run: docker build -f Dockerfile -t ${{ env.GAR_LOCATION }}/${{ matrix.module }}:${GITHUB_SHA} .
working-directory: ${{ matrix.module }}
- name: Push image
run: docker push ${{ env.GAR_LOCATION }}/${{ matrix.module }}:${GITHUB_SHA}