Skip to content

Commit 712b4ec

Browse files
authored
Merge pull request #55 from MunchLab/deploy-ghpages
2 parents 8e12050 + 3487f17 commit 712b4ec

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

.github/workflows/docs.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
paths:
66
- 'doc_source/**'
77
- 'src/ect/**'
8+
pull_request:
9+
branches: [ "main" ]
10+
paths:
11+
- 'doc_source/**'
12+
- 'src/ect/**'
813

914
jobs:
1015
docs:
@@ -14,15 +19,16 @@ jobs:
1419
steps:
1520
- uses: actions/checkout@v4
1621
with:
17-
fetch-depth: 0
18-
22+
fetch-depth: 0
23+
1924
- name: Install uv
2025
uses: astral-sh/setup-uv@v5
2126

2227
- name: Set up Python
2328
uses: actions/setup-python@v4
2429
with:
2530
python-version-file: "pyproject.toml"
31+
2632
- name: Install system dependencies
2733
run: |
2834
sudo apt-get update
@@ -40,17 +46,10 @@ jobs:
4046
source .venv/bin/activate
4147
make html
4248
43-
- name: Configure Git
44-
run: |
45-
git config --global user.name 'github-actions[bot]'
46-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
47-
48-
- name: Commit and push if changed
49-
run: |
50-
if [[ -n "$(git status --porcelain docs/)" ]]; then
51-
git add docs/
52-
git commit -m "docs: auto-generate documentation"
53-
git push origin HEAD:main
54-
else
55-
echo "No changes to commit"
56-
fi
49+
- name: Deploy to GitHub Pages
50+
if: github.event_name == 'push'
51+
uses: peaceiris/actions-gh-pages@v3
52+
with:
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
publish_dir: ./docs
55+
force_orphan: true

0 commit comments

Comments
 (0)