Skip to content

Feature/reusable workflows #13

Feature/reusable workflows

Feature/reusable workflows #13

Workflow file for this run

name: Preview Sites
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 }}"
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'
- name: "Run Job #${{ matrix.runner }}"
run: |
./github-runner-starter \
--run \
--name=github.actions.runner.${{ github.run_id }}.${{ matrix.runner }} \
--labels=github.actions.runner.${{ github.run_id }}.${{ matrix.runner }} \
--config-sh-options=--ephemeral
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 }}.${{ matrix.runner }}
# 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