Skip to content

Commit 626fbcb

Browse files
committed
Improve doc workflow
1 parent 2243401 commit 626fbcb

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/documentation.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ on:
1313
tags:
1414
- "*"
1515

16+
pull_request:
17+
branches: [main]
18+
paths:
19+
- ".github/workflows/documentation.yml"
20+
- requirements/documentation.txt
21+
1622
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1723
permissions:
1824
contents: read
@@ -54,15 +60,26 @@ jobs:
5460
- name: Build static website
5561
run: mkdocs build --verbose
5662

63+
- name: Save build doc as artifact
64+
uses: actions/upload-artifact@v3
65+
with:
66+
name: documentation
67+
path: site/
68+
if-no-files-found: error
69+
retention-days: 30
70+
5771
- name: Setup Pages
5872
uses: actions/configure-pages@v3
73+
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
5974

6075
- name: Upload artifact
6176
uses: actions/upload-pages-artifact@v1
77+
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
6278
with:
6379
# Upload entire repository
64-
path: site
80+
path: site/
6581

6682
- name: Deploy to GitHub Pages
6783
id: deployment
84+
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
6885
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)