Skip to content

Commit 8e82d06

Browse files
Add back the reusable workflow
1 parent ee6e837 commit 8e82d06

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Call this reusable workflow like
2+
# jobs:
3+
# job1:
4+
# uses: ./.github/workflows/run-hub-health-check.yaml
5+
# with:
6+
# cluster: cluster-name
7+
# hub: hub-name
8+
# provider: provider
9+
#
10+
# https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows
11+
#
12+
name: Run a hub health check
13+
14+
on:
15+
workflow_call:
16+
inputs:
17+
cluster:
18+
required: true
19+
type: string
20+
hub:
21+
required: true
22+
type: string
23+
provider:
24+
required: true
25+
type: string
26+
secrets:
27+
GCP_KMS_DECRYPTOR_KEY:
28+
required: true
29+
outputs:
30+
health_check_output:
31+
value: ${{ jobs.run_health_check.outputs.output1 }}
32+
jobs:
33+
run_health_check:
34+
runs-on: ubuntu-latest
35+
outputs:
36+
output1: ${{ steps.health_check.outputs.health_check_output }}
37+
steps:
38+
- uses: actions/checkout@v6
39+
with:
40+
submodules: true
41+
- uses: actions/setup-python@v6
42+
with:
43+
python-version: '3.13'
44+
- name: Save pip's install cache on job completion
45+
uses: actions/cache@v5
46+
with:
47+
path: ~/.cache/pip
48+
key: ${{ github.run_id }}
49+
50+
- name: Install deployer script's Python dependencies
51+
run: |
52+
pip install --editable .
53+
go install github.com/google/go-jsonnet/cmd/jsonnet@v0.20.0
54+
55+
- name: Setup deploy for ${{ inputs.cluster }} cluster
56+
uses: ./.github/actions/setup-deploy
57+
with:
58+
provider: ${{ inputs.provider }}
59+
GCP_KMS_DECRYPTOR_KEY: ${{ secrets.GCP_KMS_DECRYPTOR_KEY }}
60+
61+
- name: Run health check against ${{ inputs.cluster }} ${{ inputs.hub }}
62+
uses: nick-fields/retry@v3
63+
id: health_check
64+
with:
65+
timeout_minutes: 10
66+
max_attempts: 3
67+
command: |
68+
echo "health_check_output<<EOF" >> "$GITHUB_OUTPUT"
69+
deployer run-hub-health-check ${{ inputs.cluster }} ${{ inputs.hub }} | tee --append "$GITHUB_OUTPUT"
70+
echo "EOF" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)