Skip to content

fix cache

fix cache #49

Workflow file for this run

name: Build and Deploy to GKE
on:
push:
branches:
- master
env:
GKE_PROJECT: ${{ secrets.GKE_PROJECT }}
GKE_EMAIL: ${{ secrets.GKE_EMAIL }}
GITHUB_SHA: ${{ github.sha }}
GKE_ZONE: europe-north1
GKE_REGION: europe-north1
IMAGE: registry
REGISTRY_HOSTNAME: gcr.io
DEPLOYMENT_NAME: registry
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- run: git fetch --all --prune --unshallow --tags --recurse-submodules-default=yes
- uses: google-github-actions/auth@v0
with:
service_account: ${{ secrets.GKE_EMAIL }}
credentials_json: ${{ secrets.GKE_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v0'
- run: |
gcloud auth configure-docker
- name: Build
run: |
gcloud builds submit --tag "$REGISTRY_HOSTNAME"/"$GKE_PROJECT"/"$IMAGE":"$GITHUB_SHA"
- name: Deploy
run: |
gcloud run deploy "$DEPLOYMENT_NAME" --image "$REGISTRY_HOSTNAME"/"$GKE_PROJECT"/"$IMAGE":"$GITHUB_SHA" --platform managed --region "$GKE_REGION" --allow-unauthenticated