Skip to content

fest : using key file #27

fest : using key file

fest : using key file #27

Workflow file for this run

name: wheretobin-cicd
on:
push:
branches: [main]
pull_request:
env:
REGION: asia-southeast1
GAR_LOCATION: asia-southeast1-docker.pkg.dev/personal-388003/demo-registry-gar
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"
# - name: Add image tags
# run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
# - id: "auth"
# uses: "google-github-actions/auth@v2"
# with:
# credentials_json: "${{ secrets.SERVICE_ACCOUNT_KEY }}"
# - name: "Set up Cloud SDK"
# uses: "google-github-actions/setup-gcloud@v2"
# - 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 }}:${{ env.SHORT_SHA }} .
# working-directory: ${{ matrix.module }}
# - name: Push image
# run: docker push ${{ env.GAR_LOCATION }}/${{ matrix.module }}:${{ env.SHORT_SHA }}
deploy:
environment: dev
name: Deploy with Terraform
runs-on: ubuntu-latest
container:
image: alpine/terragrunt
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Update dependencies
run: apk update && apk add --no-cache make
- name: "Run Terragrunt"
working-directory: "terraform"
run: |-
echo "${{ secrets.SERVICE_ACCOUNT_KEY }}" > ./gcloud-sa-key.json
export GOOGLE_CLOUD_KEYFILE_JSON="./gcloud-sa-key.json"
export IMAGE_TAG=1234
make plan ENV=dev
make apply ENV=dev