Skip to content

Commit bce36b7

Browse files
committed
feat: deploy PR preview to gh pages
1 parent 0b2c140 commit bce36b7

File tree

3 files changed

+26
-36
lines changed

3 files changed

+26
-36
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
name: build
2+
concurrency: preview-${{ github.ref }}
3+
4+
permissions:
5+
contents: write
26

37
on:
48
pull_request:
59

610
jobs:
711
ci:
8-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-latest
913
steps:
1014
- uses: actions/checkout@v4
1115

@@ -19,5 +23,20 @@ jobs:
1923
- name: Install uv
2024
uses: astral-sh/setup-uv@v6
2125

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

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

.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)