Skip to content

Merge branch 'master' into deploy #32

Merge branch 'master' into deploy

Merge branch 'master' into deploy #32

Workflow file for this run

# This workflow will build a docker container, publish it to Google Container Registry, and deploy it to GKE when a release is created
#
# 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. Set up secrets in your workspace: GKE_PROJECT with the name of the project and GKE_SA_KEY with the Base64 encoded JSON service account key (https://github.com/GoogleCloudPlatform/github-actions/tree/docs/service-account-key/setup-gcloud#inputs).
#
# 3. Change the values for the GKE_ZONE, GKE_CLUSTER, IMAGE, 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
name: Build and Deploy Iam Service to GKE
on:
push:
branches: [deploy]
paths:
- 'services/iam/**'
env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
#GKE_CLUSTER: platform-beta-2 # TODO: update to cluster name
#GKE_ZONE: europe-west3 # TODO: update to cluster zone
DEPLOYMENT_NAME: iam # TODO: update to deployment name
IMAGE: iam
jobs:
setup-build-publish:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
environment: staging
steps:
- name: Checkout
uses: actions/checkout@v2
# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v0.2.1
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}
# Configure Docker to use the gcloud command-line tool as a credential
# helper for authentication
- run: |-
gcloud --quiet auth configure-docker
# Get the GKE credentials so we can deploy to the cluster
# - uses: google-github-actions/get-gke-credentials@v0.2.1
# with:
# cluster_name: ${{ env.GKE_CLUSTER }}
# location: ${{ env.GKE_ZONE }}
# credentials: ${{ secrets.GKE_SA_KEY }}
# Build the Docker image
- name: Build
run: |-
docker build \
--tag "eu.gcr.io/$PROJECT_ID/$IMAGE:$GITHUB_SHA" \
--tag "eu.gcr.io/$PROJECT_ID/$IMAGE:latest" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" \
-f ./services/iam/Dockerfile .
# Push the Docker image to Google Container Registry
- name: Publish
run: |-
docker push --all-tags "eu.gcr.io/$PROJECT_ID/$IMAGE"