File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7- pull_request :
8- branches :
9- - main
107jobs :
118 deploy :
129 permissions :
Original file line number Diff line number Diff line change 1+ # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+ # Trusted follow-up: runs in base-repo context so secrets and environments work (incl. fork PRs).
3+ # andykenward/github-actions-cloudflare-pages only supports push/pull_request/workflow_dispatch,
4+ # not workflow_run, so previews use wrangler directly (same pattern as Cloudflare docs).
5+ name : PR Preview Deploy
6+ on :
7+ workflow_run :
8+ workflows :
9+ - PR Preview Validate
10+ types :
11+ - completed
12+
13+ jobs :
14+ deploy :
15+ if : >-
16+ github.event.workflow_run.conclusion == 'success' &&
17+ github.event.workflow_run.event == 'pull_request'
18+ runs-on : ubuntu-latest
19+ timeout-minutes : 5
20+ environment : Cloudflare Pages
21+ permissions :
22+ contents : read
23+ deployments : write
24+ pull-requests : write
25+ steps :
26+ - uses : actions/checkout@v4
27+ with :
28+ repository : ${{ github.event.workflow_run.head_repository.full_name || github.repository }}
29+ ref : ${{ github.event.workflow_run.head_sha }}
30+ fetch-depth : 0
31+ - uses : actions/setup-python@v6
32+ with :
33+ python-version : 3.12
34+ cache : pip
35+ - name : Install dependencies
36+ run : pip install -r requirements.txt
37+ - name : Build docs
38+ run : mkdocs build
39+ - name : Deploy to Cloudflare Pages
40+ uses : andykenward/github-actions-cloudflare-pages@v3.0.0
41+ id : pages
42+ with :
43+ cloudflare-api-token : ${{ secrets.CLOUDFLARE_API_TOKEN }}
44+ cloudflare-account-id : ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
45+ cloudflare-project-name : ${{ vars.CLOUDFLARE_PROJECT_NAME }}
46+ directory : site
47+ github-token : ${{ secrets.GITHUB_TOKEN }}
48+ github-environment : Cloudflare Pages
Original file line number Diff line number Diff line change 1+ # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+ # Runs without secrets (safe for fork PRs). PR Preview Deploy runs after this completes.
3+ name : PR Preview Validate
4+ on :
5+ pull_request :
6+ branches :
7+ - main
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ timeout-minutes : 5
13+ permissions :
14+ contents : read
15+ steps :
16+ - uses : actions/checkout@v3
17+ with :
18+ fetch-depth : 0
19+ - uses : actions/setup-python@v6
20+ with :
21+ python-version : 3.12
22+ cache : ' pip'
23+ - name : pre-commit
24+ uses : pre-commit/action@v3.0.1
25+ with :
26+ extra_args : " --from-ref origin/main --to-ref HEAD"
You can’t perform that action at this time.
0 commit comments