Skip to content

Commit 707a327

Browse files
authored
Merge pull request #1127 from python/pr-preview
feat: deploy PR preview to gh pages
2 parents 0b2c140 + 3f47875 commit 707a327

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: build
22

3+
concurrency: preview-${{ github.ref }}
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
39
on:
410
pull_request:
511

@@ -19,5 +25,20 @@ jobs:
1925
- name: Install uv
2026
uses: astral-sh/setup-uv@v6
2127

22-
- name: Validate
28+
- name: Build HTML Docs
2329
run: VERSION=${{ github.event.repository.default_branch }} JOBS=4 MODE=html make all
30+
31+
- uses: actions/create-github-app-token@v2
32+
id: app-token
33+
with:
34+
app-id: ${{ secrets.APP_ID }}
35+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
36+
37+
- name: Deploy PR Doc Preview
38+
uses: rossjrw/pr-preview-action@v1
39+
with:
40+
source-dir: ../cpython/Doc/build/html
41+
token: ${{ steps.app-token.outputs.token }}
42+
preview-branch: gh-pages
43+
umbrella-dir: pr-preview
44+
action: auto

.github/workflows/deploy-gh-page.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
- name: Deploy to gh page
2424
uses: JamesIves/[email protected]
2525
with:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
BRANCH: gh-pages
28-
FOLDER: ../cpython/Doc/build/html
29-
CLEAN: true
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
branch: gh-pages
28+
folder: ../cpython/Doc/build/html
29+
clean: true
30+
clean-exclude: pr-preview/

.github/workflows/py313-sync-cpython.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ jobs:
3636
- name: Sync with CPython
3737
run: make clone merge rm_cpython wrap
3838

39-
- uses: tibdex/github-app-token@v2
40-
id: generate-token
39+
- uses: actions/create-github-app-token@v2
40+
id: app-token
4141
with:
42-
app_id: ${{ secrets.APP_ID }}
43-
private_key: ${{ secrets.APP_PRIVATE_KEY }}
42+
app-id: ${{ secrets.APP_ID }}
43+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
4444

4545
- name: Create Pull Request
4646
id: cpr
4747
uses: peter-evans/create-pull-request@v6
4848
with:
49-
token: ${{ steps.generate-token.outputs.token }}
49+
token: ${{ steps.app-token.outputs.token }}
5050
commit-message: sync with cpython ${{ env.LATEST_COMMIT_ID }}
5151
committer: GitHub <[email protected]>
5252
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

0 commit comments

Comments
 (0)