Build Docs #91
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
name: Build Docs | |
on: | |
# This trigger is required by fastapi-mvc automation to dispatch this concrete workflow | |
# from fastapi-mvc 'CI workflow' (https://github.com/fastapi-mvc/cookiecutter/actions/workflows/main.yml), | |
# and await its result. NOTE! This is not included in the template. | |
workflow_dispatch: | |
inputs: | |
distinct_id: | |
required: true | |
description: "Input required by codex-/return-dispatch@v1" | |
push: | |
branches: | |
- master | |
env: | |
POETRY_HOME: /opt/poetry | |
POETRY_CONFIG_DIR: /opt/poetry | |
POETRY_CACHE_DIR: /opt/poetry/cache | |
POETRY_VIRTUALENVS_PATH: /opt/poetry/store | |
jobs: | |
meta: | |
runs-on: ubuntu-latest | |
steps: | |
# This echo is required by codex-/return-dispatch@v1 in order to identify dispatched workflow. | |
# NOTE! This is not included in the template. | |
- name: echo distinct ID ${{ github.event.inputs.distinct_id }} | |
run: echo ${{ github.event.inputs.distinct_id }} | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Load Poetry cache | |
id: poetry-cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.POETRY_HOME }} | |
key: ${{ runner.os }}-3.9-${{ hashFiles('./pyproject.toml') }} | |
- name: Build documentation | |
run: make docs | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ format('docs-{0}', github.sha) }} | |
path: site | |
retention-days: 60 | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/ghaction-github-pages@v3.1.0 | |
with: | |
target_branch: gh-pages | |
build_dir: site | |
commit_message: "Deploy to GitHubPages" | |
jekyll: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |