Skip to content

Commit 3c3aa7d

Browse files
committed
Refactor GitHub Actions workflow for documentation: remove pull request trigger, streamline artifact upload, and add deployment step to GitHub Pages.
1 parent e88184a commit 3c3aa7d

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

.github/workflows/docs.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: Documentation Build Test
22

33
on:
4-
pull_request:
5-
branches:
6-
- master
4+
release:
5+
types: [published]
76
push:
8-
branches:
9-
- master
7+
tags:
8+
- '*'
109

1110
jobs:
1211
build-docs:
@@ -37,21 +36,23 @@ jobs:
3736
run: |
3837
make html
3938
40-
- name: Check for warnings and errors
41-
working-directory: docs
42-
run: |
43-
if [ -f _build/html/index.html ]; then
44-
echo "Documentation built successfully"
45-
echo "Generated files:"
46-
ls -la _build/html/
47-
else
48-
echo "Documentation build failed - index.html not found"
49-
exit 1
50-
fi
51-
52-
- name: Upload documentation artifacts
53-
uses: actions/upload-artifact@v3
39+
- name: Upload artifact for GitHub Pages
40+
uses: actions/upload-pages-artifact@v3
5441
with:
55-
name: documentation
56-
path: docs/_build/html/
57-
retention-days: 7
42+
path: docs/_build/html
43+
44+
deploy-docs:
45+
needs: build-docs
46+
runs-on: ubuntu-latest
47+
permissions:
48+
pages: write
49+
id-token: write
50+
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)