-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (66 loc) · 2.43 KB
/
mkdocs-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
# SPDX-FileCopyrightText: GitHub, Inc. and contributors
# SPDX-License-Identifier: MIT
name: "Release documentation"
on: # yamllint disable-line rule:truthy
push:
branches: [main]
paths:
- docs/**
- mkdocs.yml
- pyproject.toml
- .github/workflows/docs-release.yml
pull_request:
types: [closed]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
# Default to bash
defaults:
run:
shell: bash
jobs:
build-and-deploy:
if: github.event.pull_request.merged == true
permissions:
pages: write
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: "🧰 Checkout Source Code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "⚙️️ Set up Python"
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
# Read python version from a file .python-version
python-version-file: ".standard-python-version"
check-latest: true
cache: pip
- name: "⚙️️ Get full Python version"
id: full-python-version
run: echo version="$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> "$GITHUB_OUTPUT"
- name: "⚙️️ Set up cache"
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: "🧰 Install Hatch"
run: pip install --upgrade hatch
- name: Build and deploy with MkDocs
run: hatch run docs:build
- name: Deploy
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: ${{ github.event.head_commit.message }}