mirror of
https://github.com/blackboxprogramming/simulation-theory.git
synced 2026-03-17 01:57:10 -05:00
The deploy workflow only triggered on push to main and workflow_dispatch, so the CI job was never started for pull requests. This prevented PRs from being merged when required status checks were configured. - Add pull_request trigger targeting the main branch - Add conditional guards to skip actual deployment on PR events - On PRs, the job runs (creating the status check) but skips deploy steps Co-authored-by: blackboxprogramming <118287761+blackboxprogramming@users.noreply.github.com>
43 lines
871 B
YAML
43 lines
871 B
YAML
name: Deploy to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Pages
|
|
if: github.event_name != 'pull_request'
|
|
uses: actions/configure-pages@v4
|
|
|
|
- name: Upload artifact
|
|
if: github.event_name != 'pull_request'
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: .
|
|
|
|
- name: Deploy to GitHub Pages
|
|
if: github.event_name != 'pull_request'
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|