Skip to content

Commit 1ccad12

Browse files
CI: Trigger preview of the web/docs (#50899)
1 parent 29140d4 commit 1ccad12

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/docbuild-and-upload.yml

+7
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,10 @@ jobs:
8989
name: website
9090
path: web/build
9191
retention-days: 14
92+
93+
- name: Trigger web/doc preview
94+
run: curl -X POST https://pandas.pydata.org/preview/submit/$RUN_ID/$PR_ID/
95+
env:
96+
RUN_ID: ${{ github.run_id }}
97+
PR_ID: ${{ github.event.pull_request.number }}
98+
if: github.event_name == 'pull_request'

.github/workflows/preview-docs.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Preview docs
2+
on:
3+
issue_comment:
4+
types: created
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
preview_docs:
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- if: github.event.comment.body == '/preview'
17+
run: |
18+
if curl --output /dev/null --silent --head --fail "https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"; then
19+
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "Website preview of this PR available at: https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
20+
else
21+
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "No preview found for PR #${{ github.event.issue.number }}. Did the docs build complete?"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
22+
fi

0 commit comments

Comments
 (0)