Deploy MkDocs to GitHub Pages #356
This file contains hidden or 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: Deploy MkDocs to GitHub Pages | |
on: | |
schedule: | |
- cron: 0 3 * * * | |
push: | |
branches: | |
- develop | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout docs | |
uses: actions/checkout@v4 | |
- name: Checkout lapidary | |
uses: actions/checkout@v4 | |
with: | |
repository: python-lapidary/lapidary | |
ref: develop | |
path: docs/lapidary | |
- name: Checkout lapidary-render | |
uses: actions/checkout@v4 | |
with: | |
repository: python-lapidary/lapidary-render | |
ref: develop | |
path: docs/lapidary-render | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Cache Poetry dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pypoetry | |
~/.cache/pip | |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
poetry install --no-root | |
- name: Build site | |
run: poetry run mkdocs build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./site | |
cname: lapidary.dev | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |