Skip to content

Commit 0db7de0

Browse files
committed
CI: add a job to deploy to gh-pages for commits on main
1 parent 9314fd7 commit 0db7de0

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/pages.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to gh-pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish:
10+
name: 'Publish'
11+
runs-on: ubuntu-latest
12+
# Avoid running this workflow for forks:
13+
if: "github.repository == 'data-apis/dataframe-api'"
14+
steps:
15+
- name: 'Checkout repository'
16+
uses: actions/checkout@v3
17+
18+
- name: 'Install Python'
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.10'
22+
23+
- name: 'Install dependencies'
24+
run: pip install -r ./requirements.txt
25+
26+
- name: 'Build documentation'
27+
run: |
28+
# Turn warnings into errors and ensure .doctrees is not deployed:
29+
sphinx-build -b html -WT --keep-going spec build/draft -d doctrees
30+
31+
- name: 'Configure Git'
32+
run: |
33+
git config --local user.email "[email protected]"
34+
git config --local user.name "dataframe-api-bot"
35+
36+
- name: 'Checkout gh-pages'
37+
run: |
38+
git fetch --all
39+
git checkout gh-pages
40+
41+
- name: 'Copy build artifact'
42+
run: rm -rf ./draft && cp -R ./build/draft ./draft
43+
44+
- name: 'Commit changes'
45+
run: git add . && git commit -m "Deploy: ${{ github.sha }}"
46+
47+
- name: 'Push changes'
48+
if: success()
49+
run: git push origin gh-pages

0 commit comments

Comments
 (0)