Skip to content

feat: deploy PR preview to gh pages #1127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: build

concurrency: preview-${{ github.ref }}

permissions:
contents: write
pull-requests: write

on:
pull_request:

Expand All @@ -19,5 +25,20 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Validate
- name: Build HTML Docs
run: VERSION=${{ github.event.repository.default_branch }} JOBS=4 MODE=html make all

- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Deploy PR Doc Preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ../cpython/Doc/build/html
token: ${{ steps.app-token.outputs.token }}
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
9 changes: 5 additions & 4 deletions .github/workflows/deploy-gh-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
- name: Deploy to gh page
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: ../cpython/Doc/build/html
CLEAN: true
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: ../cpython/Doc/build/html
clean: true
clean-exclude: pr-preview/
10 changes: 5 additions & 5 deletions .github/workflows/py313-sync-cpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ jobs:
- name: Sync with CPython
run: make clone merge rm_cpython wrap

- uses: tibdex/github-app-token@v2
id: generate-token
- uses: actions/create-github-app-token@v2
id: app-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

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