Skip to content

Merge pull request #98 from iandyh/split #1

Merge pull request #98 from iandyh/split

Merge pull request #98 from iandyh/split #1

Workflow file for this run

# This workflow will build a docker container, publish it to Google Container Registry, and deploy it to GKE when there is a push to the "master" branch.
#
# To configure this workflow:
#
# 1. Ensure that your repository contains the necessary configuration for your Google Kubernetes Engine cluster, including deployment.yml, kustomization.yml, service.yml, etc.
#
# 2. Create and configure a Workload Identity Provider for GitHub (https://github.com/google-github-actions/auth#setting-up-workload-identity-federation)
#
# 3. Change the values for the GAR_LOCATION, GKE_ZONE, GKE_CLUSTER, IMAGE, REPOSITORY and DEPLOYMENT_NAME environment variables (below).
#
# For more support on how to run the workflow, please visit https://github.com/google-github-actions/setup-gcloud/tree/master/example-workflows/gke-kustomize
name: Build and Deploy to GCP registry
on:
push:
branches: [ "split", "master" ]
env:
GAR_LOCATION: asia-northeast1 # TODO: update region of the Artifact Registry
IMAGE: shibuya
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish
runs-on: ubuntu-20.04
environment: production
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.17'
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
token_format: 'access_token'
- name: Docker configuration
run: |-
echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://$GAR_LOCATION-docker.pkg.dev
# Build the Docker image
- name: Build api
run: |-
cd shibuya && make api_image component=api
- name: Build controller
run: |-
cd shibuya && make controller_image component=controller
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: "v3.13.3"
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: shibuya/install
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"