Update self_runner_test.yml #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dynamic Runner | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
start-runner: | |
runs-on: flysql26-dispatch | |
outputs: | |
uuid: ${{ steps.generate_uuid.outputs.uuid }} | |
steps: | |
- name: Generate UUID | |
id: generate_uuid | |
run: | | |
UUID=$(uuidgen) | |
echo "UUID=$UUID" >> $GITHUB_ENV | |
echo "::set-output name=uuid::$UUID" | |
- 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 | |
- name: Start Dockerized Runner | |
env: | |
CREATE_RUNNER_TOKEN: ${{ secrets.CREATE_RUNNER_TOKEN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
UUID: ${{ steps.generate_uuid.outputs.uuid }} | |
run: | | |
bash /var/go/actions-runner-dispatch/agr_github_runner/runner-controller.sh start | |
use-runner: | |
needs: start-runner | |
runs-on: ${{ needs.start-runner.outputs.uuid }} | |
steps: | |
- 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 | |
- name: Log in to ECR | |
uses: alliance-genome/agr_github_runner/.github/actions/login_to_ecr@main | |
env: | |
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: | |
needs: use-runner | |
runs-on: flysql26-dispatch | |
steps: | |
- 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 | |
- name: Stop Dockerized Runner | |
env: | |
UUID: ${{ needs.start-runner.outputs.uuid }} | |
run: | | |
bash /var/go/actions-runner-dispatch/agr_github_runner/runner-controller.sh stop $UUID |