Skip to content

Commit 38ac9b5

Browse files
authored
Merge pull request #54 from Xylambda/test-github-actions
Update GitHub Actions workflow for testing
2 parents 39cd9a3 + c692c55 commit 38ac9b5

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

.github/workflows/gh-pages.yml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,39 @@ on:
44
push:
55
branches:
66
- master
7-
- develop
7+
pull_request:
8+
branches:
9+
- master
810

911
jobs:
1012
build_docs_job:
1113
runs-on: ubuntu-latest
12-
env:
13-
GITHUB_PAT: ${{ secrets.PUSH_TOKEN }}
1414

1515
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v3
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
1818

19-
- name: Python Set Up
19+
- name: Set up Python
2020
uses: actions/setup-python@v4
2121
with:
2222
python-version: 3.8
2323

2424
- name: Upgrade pip
2525
run: |
26-
# install pip=>20.1 to use "pip cache dir"
27-
python3 -m pip install --upgrade pip
26+
python -m pip install --upgrade pip
2827
2928
- name: Install dependencies
3029
run: |
31-
python3 -m pip install . -r requirements-dev.txt
30+
python -m pip install . -r requirements-dev.txt
3231
33-
- name: Make Sphinx docs
32+
- name: Build Sphinx documentation
3433
run: |
3534
make -C docs clean
3635
make -C docs html
3736
38-
- name: Init new repository in dist folder and commit generated files
39-
run: |
40-
cd docs/build/html/
41-
git init
42-
git remote add origin https://${{ secrets.PUSH_TOKEN }}@github.com/Xylambda/kalmankit
43-
git config --global --add safe.directory /github/workspace/docs/build/html
44-
touch .nojekyll
45-
git add -A
46-
git config --local user.email "[email protected]"
47-
git config --local user.name "GitHub Action"
48-
git commit -m 'deploy'
49-
50-
- name: Force push to destination branch
51-
uses: ad-m/[email protected]
37+
- name: Deploy to GitHub Pages
38+
uses: peaceiris/actions-gh-pages@v4
5239
with:
53-
github_token: ${{ secrets.PUSH_TOKEN }}
54-
branch: gh-pages
55-
force: true
56-
directory: ./docs/build/html
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
publish_branch: gh-pages
42+
publish_dir: docs/build/html

0 commit comments

Comments
 (0)