Skip to content

Deploy

Deploy #15

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
workflow_call:
secrets:
GKE_SA_KEY:
description: 'GKE_SA_KEY'
required: true
GKE_PROJECT:
description: 'GKE_PROJECT'
required: true
ACCESS_TOKEN:
description: 'ACCESS_TOKEN'
required: true
env:
GKE_CLUSTER: jx-prod
GKE_ZONE: us-east1-b
RUNNER_NAMESPACE: webui
DOCKER_REGISTRY: us-east1-docker.pkg.dev
IMAGE_VERSION: latest
DOCKER_IMAGE: ${{ secrets.GKE_PROJECT }}/webui/gh-runner
GITHUB_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
jobs:
runner-image:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Get GKE credentials
uses: google-github-actions/get-gke-credentials@v0.2.1
with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}
project_id: ${{ secrets.GKE_PROJECT }}
credentials: ${{ secrets.GKE_SA_KEY }}
- name: Check runner namespace
id: runner_ns
run: |
echo ::set-output name=exists::$(kubectl get namespace ${RUNNER_NAMESPACE})
- name: Create runner namespace
if: ${{ !steps.runner_ns.outputs.exists }}
run: |
kubectl create namespace ${{ env.RUNNER_NAMESPACE }}
- name: Install runner image
id: runner
working-directory: ./charts/runner
run: |
# substitute env variables in values.yaml
mv values.yaml values.yaml.tosubst
envsubst < values.yaml.tosubst > values.yaml
# install
helm upgrade --install --namespace ${RUNNER_NAMESPACE} ${RUNNER_NAMESPACE} .