diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6bd32c1cd..84b9b582c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,11 @@ name: build +concurrency: preview-${{ github.ref }} + +permissions: + contents: write + pull-requests: write + on: pull_request: @@ -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 diff --git a/.github/workflows/deploy-gh-page.yml b/.github/workflows/deploy-gh-page.yml index 2c7442c1a8..05f00a9ad1 100644 --- a/.github/workflows/deploy-gh-page.yml +++ b/.github/workflows/deploy-gh-page.yml @@ -23,7 +23,8 @@ jobs: - name: Deploy to gh page uses: JamesIves/github-pages-deploy-action@v4.7.3 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/ diff --git a/.github/workflows/py313-sync-cpython.yml b/.github/workflows/py313-sync-cpython.yml index f3362c52c5..e826525144 100644 --- a/.github/workflows/py313-sync-cpython.yml +++ b/.github/workflows/py313-sync-cpython.yml @@ -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 author: github-actions[bot]