-
Notifications
You must be signed in to change notification settings - Fork 85
58 lines (49 loc) · 1.76 KB
/
helm-install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# A simple workflow which deploys the papyrus helm chart to a gke cluster, waits for the pod to be
# ready and then deletes the release.
name: helm-install
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- deployments/**
- config/default_config.json
- .github/workflows/helm-install.yml
jobs:
deploy-teardown:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set a unique run identifier
run: echo "UNIQE_ID=${{ github.run_number }}-${{ github.run_attempt }}" >> $GITHUB_ENV
- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GOOGLE_CI_SA_CREDENTIALS }}"
- id: "get-credentials"
name: Get GKE credentials
uses: "google-github-actions/get-gke-credentials@v1"
with:
cluster_name: "${{ secrets.GKE_CI_CLUSTER_NAME }}"
location: "${{ secrets.GKE_CI_CLUSTER_REGION }}"
- id: "helm-install"
name: Deploy to Kubernetes using helm
run: |
helm upgrade --install papyrus-${UNIQE_ID} deployments/helm/ \
--namespace papyrus \
--values deployments/helm/CI/values.yaml \
--set base_layer_node_url=${{ secrets.CI_BASE_LAYER_NODE_URL }} \
--create-namespace
- name: Wait for papyrus pods to be ready
run: kubectl --namespace papyrus rollout status deployment papyrus-${UNIQE_ID} --timeout 5m
- name: Clean the deployment
if: always()
run: |
chmod 600 "$KUBECONFIG"
helm uninstall --namespace papyrus papyrus-${UNIQE_ID}