-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (85 loc) · 2.92 KB
/
docs.yml
File metadata and controls
100 lines (85 loc) · 2.92 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: docs
on:
push:
branches:
- master
- init
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
environment: docs
steps:
- uses: actions/checkout@v6
- name: Filter changed file paths to outputs
uses: dorny/paths-filter@v4
id: changes
with:
filters: |
publishable:
- 'README.*'
- 'CHANGES'
- 'docs/**'
- 'packages/**'
- 'scripts/ci/**'
- '.github/workflows/docs.yml'
- '.github/workflows/tests.yml'
- 'pyproject.toml'
- 'uv.lock'
- name: Set up Python 3.14
if: steps.changes.outputs.publishable == 'true'
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install uv
if: steps.changes.outputs.publishable == 'true'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install workspace dependencies
if: steps.changes.outputs.publishable == 'true'
run: uv sync --all-packages --all-extras --group dev
- name: Install just
if: steps.changes.outputs.publishable == 'true'
uses: extractions/setup-just@v3
- name: Print Python versions
if: steps.changes.outputs.publishable == 'true'
run: |
python -V
uv run python -V
- name: Cache sphinx fonts
if: steps.changes.outputs.publishable == 'true'
uses: actions/cache@v5
with:
path: ~/.cache/sphinx-fonts
key: sphinx-fonts-${{ hashFiles('docs/conf.py') }}
restore-keys: |
sphinx-fonts-
- name: Build documentation
if: steps.changes.outputs.publishable == 'true'
run: uv run sphinx-build -W -b html docs docs/_build/html
- name: Configure AWS Credentials
if: steps.changes.outputs.publishable == 'true'
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.GP_SPHINX_DOCS_ROLE_ARN }}
aws-region: us-east-1
- name: Push documentation to S3
if: steps.changes.outputs.publishable == 'true'
run: |
aws s3 sync docs/_build/html "s3://${{ secrets.GP_SPHINX_DOCS_BUCKET }}" \
--delete --follow-symlinks
- name: Invalidate CloudFront
if: steps.changes.outputs.publishable == 'true'
run: |
aws cloudfront create-invalidation \
--distribution-id "${{ secrets.GP_SPHINX_DOCS_DISTRIBUTION }}" \
--paths "/index.html" "/objects.inv" "/searchindex.js"
- name: Purge cache on Cloudflare
if: steps.changes.outputs.publishable == 'true'
uses: jakejarvis/cloudflare-purge-action@v0.3.0
env:
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}