-
Notifications
You must be signed in to change notification settings - Fork 14
37 lines (32 loc) · 1.13 KB
/
tear_down_runners.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
name: Tear down repository runners
on:
workflow_dispatch:
repository_dispatch:
types: [ teardown_runners ]
schedule:
# nightly 1030pm since the repo_example runs at 10
- cron: "0 22 30 * *"
jobs:
tear-down-runners:
name: Tear down repository runners
runs-on: ubuntu-20.04
env:
HELM_RELEASE_NAME: "node-runner"
steps:
- uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
namespace: ${{ secrets.OPENSHIFT_NAMESPACE }}
insecure_skip_tls_verify: true
- run: helm ls
# If we were running in the same workflow as the self-hosted runner installation,
# we could use ${{ <job>.outputs.helm_release_name }} to get the release name
- run: |
if helm status ${{ env.HELM_RELEASE_NAME }}; then
echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
else
echo "Release ${{ env.HELM_RELEASE_NAME }} not found"
fi
- run: helm uninstall ${{ env.HELM_RELEASE_NAME }}
if: env.RELEASE_EXISTS == 'true'