Skip to content

Kick off the runner script over and over until there are no more queu… #16

Kick off the runner script over and over until there are no more queu…

Kick off the runner script over and over until there are no more queu… #16

Workflow file for this run

name: Preview Sites

Check failure on line 1 in .github/workflows/site.preview.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/site.preview.yml

Invalid workflow file

(Line: 29, Col: 14): Unrecognized named-value: 'GITHUB_TOKEN'. Located at position 1 within expression: GITHUB_TOKEN
on:
pull_request:
env:
# https://github.com/operations-project/github-runner-starter/settings/secrets/actions/JONPUGH_GITHUB_TOKEN_ADMIN
GITHUB_TOKEN: "${{ secrets.OPERATIONS_GITHUB_TOKEN_ADMIN }}"
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
jobs:
create-server:
name: Launch a test server
runs-on: ubuntu-latest
# strategy:
# matrix:
# Create one runner for each job that needs to run, including the remote reusable workflow.
# runner: [ 1,2,3 ]
steps:
- uses: actions/checkout@v4
with:
repository: 'operations-project/github-runner-starter'
ref: 'v1.2.1'
# Kick off the runner script over and over until there are no more queued jobs.
- name: "Launch runner script."
run: |
while [[ $(curl -s -H "Authorization: token ${{ GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" | jq -r '.jobs[] | select(.status=="queued") | .id' | wc -l) -gt 0 ]]; do
./github-runner-starter \
--run \
--name=github.actions.runner.${{ github.run_id }}.${{ matrix.runner }} \
--labels=github.actions.runner.${{ github.run_id }}
--config-sh-options=--ephemeral
done
create-site:
name: Create Preview Site
uses: operations-project/github-action-ddev-runner/.github/workflows/ddev.site.deploy.yml@feature/reusable-workflows
with:
# Configure your site here.
git_root: /home/runner/ourproject/pr${{ github.event.number }}
# Must be unique per server.
ddev_project_name: ourproject.pr${{ github.event.number }}
# Used to create a system domain.
ddev_project_tld: sites.thinkdrop.net
# Tell the remote workflow what to run on.
github_runs_on: github.actions.runner.${{ github.run_id }}
# Define a github environment name.
github_environment: pr${{ github.event.number }}
# Additional ddev config to apply to the environment.
# Will be saved to .ddev/config.zzz.runner.yaml
ddev_config: |
additional_fqdns:
- admin.pr${{ github.event.number }}.sites.thinkdrop.net