-
Notifications
You must be signed in to change notification settings - Fork 14
78 lines (64 loc) · 2.26 KB
/
repo_example.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Install into repository
on:
push:
workflow_dispatch:
schedule:
# nightly 10pm and the teardown workflow runs just after
- cron: "0 22 * * *"
jobs:
install-repo-runner:
runs-on: ubuntu-20.04
name: Install runner into this repository
strategy:
matrix:
runner_tag: [ v1, latest ]
fail-fast: false
steps:
- name: Checkout action
uses: actions/checkout@v2
- 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
- name: Install self hosted runner into repository
id: install-runners
# uses: redhat-actions/openshift-actions-runner-installer@v1
# Test the checked-out version of this runner - a user would need the above 'uses'.
uses: ./
with:
# This token has 'repo' permissions
github_pat: ${{ secrets.REPO_TOKEN }}
helm_release_name: node-${{ matrix.runner_tag }}-runner
# Give the runner these two labels (which are required by the workflow below)
runner_labels: node
# Use this container image for the runner.
runner_image: quay.io/redhat-github-actions/node-runner-14
# Use this tag for the runner_image
runner_tag: ${{ matrix.runner_tag }}
helm_extra_args: |
--set-string secretName=github-pat-repo-${{ matrix.runner_tag }}
# Create 2 replicas so we can run jobs in parallel
runner_replicas: 2
- name: Echo outputs
shell: bash
run: |
echo "${{ toJSON(steps.install-runners.outputs) }}"
dispatch:
name: Dispatch another workflow
runs-on: ubuntu-20.04
needs: install-repo-runner
steps:
- uses: peter-evans/[email protected]
with:
token: ${{ secrets.REPO_TOKEN }}
# See ./dispatched_example.yml for the type to use.
event-type: runner_ready
test-selfhosted:
name: Self Hosted Node Workflow
runs-on: [ self-hosted, node ]
needs: install-repo-runner
steps:
- run: node --version
- run: npm --version