Trigger astroautomata.com site rebuild #41
This file contains hidden or 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: Trigger astroautomata.com site rebuild | |
| on: | |
| workflow_run: | |
| workflows: ["CI (Web UI)"] | |
| types: [completed] | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| symbolic_regression_ref: | |
| description: "Git ref (branch/tag/SHA). Leave blank to deploy main." | |
| required: false | |
| default: "main" | |
| jobs: | |
| dispatch: | |
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| env: | |
| SR_REF: ${{ github.event.workflow_run.head_sha || github.event.inputs.symbolic_regression_ref || 'main' }} | |
| steps: | |
| - name: Trigger website Pages workflow | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.ASTROAUTOMATA_SITE_DISPATCH_TOKEN }} | |
| script: | | |
| const srRef = process.env.SR_REF; | |
| await github.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { | |
| owner: 'MilesCranmer', | |
| repo: 'milescranmer.github.io', | |
| workflow_id: 'jekyll.yml', | |
| ref: 'master', | |
| inputs: { symbolic_regression_ref: srRef }, | |
| }); |