-
Notifications
You must be signed in to change notification settings - Fork 116
77 lines (71 loc) · 2.37 KB
/
Copy pathdocs.yaml
File metadata and controls
77 lines (71 loc) · 2.37 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright 2024 The PyAthena authors
#
# Licensed under the MIT License.
# See LICENSE or https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: MIT
name: Docs
on:
workflow_dispatch:
push:
branches: ['master']
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: '3.12'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Fetch all history for sphinx-multiversion
# sphinx-multiversion builds every version tag in the checkout. A tag
# gets its GitHub release only after the Release workflow's tests and
# PyPI upload succeed, so drop tags without one: a release still in
# progress or refused by its tests is not documented.
- name: Drop unreleased version tags
env:
GH_TOKEN: ${{ github.token }}
run: |
released=$(gh api --paginate "repos/$GITHUB_REPOSITORY/releases?per_page=100" \
--jq '.[] | select(.draft | not) | .tag_name')
if [[ -z "$released" ]]; then
echo "::error::No published GitHub releases found"
exit 1
fi
git tag --list 'v*' | while read -r tag; do
grep -qxF "$tag" <<< "$released" || git tag --delete "$tag"
done
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
- uses: taiki-e/install-action@7a79fe8c3a13344501c80d99cae481c1c9085912 # v2.81.10
with:
tool: just
- run: |
uv sync --group dev
just docs build
- name: Upload artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: './docs/_build/html'
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0