Skip to content

Commit

Permalink
Improve doc workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Feb 23, 2023
1 parent 2243401 commit 626fbcb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ on:
tags:
- "*"

pull_request:
branches: [main]
paths:
- ".github/workflows/documentation.yml"
- requirements/documentation.txt

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
Expand Down Expand Up @@ -54,15 +60,26 @@ jobs:
- name: Build static website
run: mkdocs build --verbose

- name: Save build doc as artifact
uses: actions/upload-artifact@v3
with:
name: documentation
path: site/
if-no-files-found: error
retention-days: 30

- name: Setup Pages
uses: actions/configure-pages@v3
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')

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

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

0 comments on commit 626fbcb

Please sign in to comment.