Skip to content

5.24.0

5.24.0 #79

Workflow file for this run

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}:${{github.ref_name}}
URL: "https://docs.rarimo.com"
DOMAIN: staging.docs.rarimo.com
BASE_URL: "/"
STAGING: "false"
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
SA_KEY: ${{ secrets.GKE_SA_KEY }}
GKE_CLUSTER: websites
GKE_ZONE: us-central1-c
jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Cache layers
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/.skaffold/cache"
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-
- name: Run Skaffold pipeline as command
uses: hiberbee/github-action-skaffold@latest
id: build
with:
command: build --tag ${{ github.ref_name }}
repository: ghcr.io/${{ github.repository_owner }}
deploy:
name: Deploy
needs: converge
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v3
with:
token: ${{ secrets.GITHUB_TOKEN }} # only needed if version is 'latest'
id: install
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
project_id: '${{ env.PROJECT_ID }}'
credentials_json: '${{ env.SA_KEY }}'
- name: Set up GKE credentials
uses: google-github-actions/get-gke-credentials@v2
with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}
namespace: docs-prod
- name: Deploy to GKE
run: |
kubectl get pods -n docs-prod
helm upgrade -i "docs" ".helm" --set global.IngressDomain=docs.rarimo.com --set "image.repository=ghcr.io/${GITHUB_REPOSITORY}" --set "image.tag=${GITHUB_REF_NAME}" --namespace docs-prod