Fix docs job (#22) #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- closed | |
jobs: | |
publish_pages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
- name: Install Dependencies | |
run: | | |
pip install poetry | |
poetry config virtualenvs.in-project true | |
poetry install | |
- name: Build documentation | |
run: | | |
poetry run mkdocs build | |
- name: Publish preview | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: rossjrw/pr-preview-action@v1 | |
with: | |
source-dir: site | |
- name: Publish Pages | |
if: ${{ github.event_name == 'push' }} | |
run: poetry run mkdocs gh-deploy |