Repository navigation
60 lines (53 loc) · 1.59 KB
/
Copy pathdocs.yml
File metadata and controls
60 lines (53 loc) · 1.59 KB
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
name: Deploy Docs
on:
push:
branches: [main]
paths:
- 'cogant/docs/**'
- 'cogant/mkdocs.yml'
- 'cogant/py/**'
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
workflow_dispatch:
jobs:
deploy:
# Run on direct push, or when triggered by a successful CI run
if: >
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest
defaults:
run:
working-directory: cogant
permissions:
contents: write
# ``peaceiris/actions-gh-pages@v4`` has not yet shipped a Node-24
# release, so opt the whole job into the new runtime explicitly.
# Remove this once the action publishes its Node-24 update or we
# migrate to ``actions/deploy-pages``.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v8.1.0
with:
version: "latest"
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: uv sync --extra dev
- name: Build docs
run: uv run mkdocs build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_run'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: cogant/site