planktoscope/.github/workflows/docs.yml

62 lines
1.4 KiB
YAML
Raw Normal View History

2023-04-27 15:10:13 +02:00
name: release docs
on:
push:
tags:
- hatch-v*
- hatchling-v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- name: Ensure latest pip
run: python -m pip install --upgrade pip
- name: Install env
run: pip install -e .
- name: Configure Git for GitHub Actions bot
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build documentation
run: hatch run docs:build
env:
GH_TOKEN_MKDOCS_MATERIAL_INSIDERS: ${{ secrets.GH_TOKEN_MKDOCS_MATERIAL_INSIDERS }}
- name: Create archive
run: git archive -o site.zip gh-pages
- uses: actions/upload-artifact@v3
with:
name: documentation
path: site.zip
publish:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/download-artifact@v3
with:
name: documentation
- name: Unpack archive
run: python -m zipfile -e site.zip site
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site
commit_message: ${{ github.event.head_commit.message }}
enable_jekyll: false
allow_empty_commit: false