-
Notifications
You must be signed in to change notification settings - Fork 5
86 lines (74 loc) · 2.88 KB
/
self_runner_test.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
79
80
81
82
83
84
85
86
name: Dynamic Runner
on:
workflow_dispatch:
push:
jobs:
setup:
runs-on: flysql26-dispatch
outputs:
uuid: ${{ steps.generate_uuid.outputs.uuid }}
steps:
- name: Generate UUID
id: generate_uuid
run: |
UUID=$(uuidgen)
echo "UUID=$UUID"
echo "UUID=$UUID" >> $GITHUB_ENV
echo "::set-output name=uuid::$UUID"
- name: Check UUID in Setup
run: echo "UUID ${{env.UUID}}"
- name: Remove existing agr_github_runner directory
run: |
if [ -d "/var/go/actions-runner-dispatch/agr_github_runner" ]; then
rm -rf /var/go/actions-runner-dispatch/agr_github_runner
fi
- name: Clone agr_github_runner repository
run: |
git clone https://github.com/alliance-genome/agr_github_runner.git /var/go/actions-runner-dispatch/agr_github_runner
start-runner:
runs-on: flysql26-dispatch
needs: setup
outputs:
uuid: ${{ steps.start_dockerized_runner.outputs.uuid }}
steps:
- name: Check UUID in Start Runner
run: echo "Start Runner UUID ${{ needs.setup.outputs.uuid }}"
- name: Start Dockerized Runner
id: start_dockerized_runner
uses: alliance-genome/agr_github_runner/.github/actions/start_runner@main
with:
UUID: ${{ needs.setup.outputs.uuid }}
ACCESS_TOKEN: ${{ secrets.CREATE_RUNNER_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
use-runner:
needs: start-runner
runs-on: ${{ needs.start-runner.outputs.uuid }}
steps:
- name: Check UUID in Use Runner
run: echo "Use Runner UUID ${{ needs.start-runner.outputs.uuid }}"
- name: Log in to ECR
uses: alliance-genome/agr_github_runner/.github/actions/login_to_ecr@main
with:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Construct NEO_ENV_IMAGE
id: construct-image
env:
REGISTRY: 100225593120.dkr.ecr.us-east-1.amazonaws.com
DOCKER_PULL_TAG: "stage" # Adjust as needed
run: echo "NEO_ENV_IMAGE=${{ env.REGISTRY }}/agr_neo4j_env:${{ env.DOCKER_PULL_TAG }}" >> $GITHUB_ENV
- name: Start Neo4j Environment
uses: alliance-genome/agr_github_runner/.github/actions/start_neo4j_env@main
stop-runner:
runs-on: flysql26-dispatch
needs: use-runner
steps:
- name: Stop Dockerized Runner
uses: alliance-genome/agr_github_runner/.github/actions/start_runner@main
with:
command: stop
UUID: ${{ needs.start-runner.outputs.uuid }}
ACCESS_TOKEN: ${{ secrets.CREATE_RUNNER_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}