chore: rename dockerfile #3
Workflow file for this run
This file contains 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 and Deploy to GKE Dev | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- cicd | |
release: | |
types: [prereleased] | |
# Environment variables available to all jobs and steps in this workflow | |
env: | |
REGISTRY_HOSTNAME: gcr.io | |
GKE_PROJECT: console-labs-prod | |
IMAGE: consolelabs/mochi-web | |
K8S_ENVIRONMENT: dev | |
SHA: ${{ github.sha }} | |
jobs: | |
setup-build-publish-deploy: | |
name: Setup, Build, Publish, and Deploy | |
environment: Preview – websites-mochi | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GCR | |
uses: docker/login-action@v3 | |
with: | |
registry: gcr.io | |
username: _json_key | |
password: ${{ secrets.GCP_CREDENTIALS }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
${{ env.REGISTRY_HOSTNAME }}/${{ env.GKE_PROJECT }}/${{ env.IMAGE }} | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha,prefix=,suffix=,format=long | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
build-args: | | |
NEXT_PUBLIC_MOCHI_PROFILE_API_HOST="${{ secrets.NEXT_PUBLIC_MOCHI_PROFILE_API_HOST }}" | |
NEXT_PUBLIC_MOCHI_API_HOST="${{ secrets.NEXT_PUBLIC_MOCHI_PROFILE_API_HOST }}" | |
NEXT_PUBLIC_MOCHI_PAY_API_HOST="${{ secrets.NEXT_PUBLIC_MOCHI_PROFILE_API_HOST }}" | |
# Setup kustomize | |
# - name: Setup kustomize | |
# run: | | |
# curl -o kustomize --location https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64 | |
# chmod u+x ./kustomize | |
# mv kustomize /tmp | |
# - name: Checkout consolelabs/infrastructure | |
# uses: actions/checkout@master | |
# with: | |
# repository: consolelabs/infrastructure | |
# token: ${{ secrets.GH_PAT }} | |
# path: ./infrastructure | |
# ref: main | |
# - name: Update discord version | |
# run: | | |
# cd ./infrastructure/tono-discord/$K8S_ENVIRONMENT | |
# git config user.name jphuc96 | |
# git config user.email [email protected] | |
# /tmp/kustomize edit set image $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE=$REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:${SHA} | |
# git commit -am "[skip ci] tono-discord ${K8S_ENVIRONMENT} image update" | |
# git push origin main | |