Repository navigation
97 lines (82 loc) · 3.08 KB
/
Copy pathdeploy.yml
File metadata and controls
97 lines (82 loc) · 3.08 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
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: CC-BY-3.0
name: Deploy Sphinx Docs
on:
push:
branches: [main]
workflow_dispatch:
inputs:
version:
description: "Line to publish (all, 13, 14, 15, main, or future detected line)"
required: true
default: all
type: string
schedule:
- cron: "23 4 * * *" # Capture release/backport changes without cross-repository credentials
repository_dispatch:
types: [libresign-documentation-release, libresign-documentation-backport]
permissions:
contents: write
concurrency:
group: libresign-docs-pages-deploy
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Choose version to publish
env:
INPUT_VERSION: ${{ inputs.version }}
EVENT_VERSION: ${{ github.event.client_payload.version }}
run: |
version="${INPUT_VERSION:-${EVENT_VERSION:-all}}"
if ! [[ "$version" =~ ^(all|main|[1-9][0-9]*)$ ]]; then
echo "Invalid release version: $version" >&2
exit 1
fi
echo "DOC_VERSION=$version" >> "$GITHUB_ENV"
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.13'
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt openapi-spec-validator==0.7.2
- name: Run versioning tests
run: python -m unittest discover -s tests -v
- name: Build requested Sphinx release
run: python -m versioning.build --version "$DOC_VERSION" --output _build
- name: Verify built release against source contract
run: python -m versioning.verify --output _build --version "$DOC_VERSION"
- name: Checkout existing Pages for partial deploy
if: env.DOC_VERSION != 'all'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: gh-pages
path: _existing_pages
persist-credentials: false
- name: Assemble isolated publish tree (never erase other releases)
run: |
if [ "$DOC_VERSION" = "all" ]; then
python -m versioning.publish --built _build --destination _publish --version all
else
python -m versioning.publish --built _build --existing _existing_pages \
--destination _publish --version "$DOC_VERSION"
fi
- name: Verify all versions are intact in candidate
run: python -m versioning.verify --output _publish
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v5
with:
build_dir: _publish
fqdn: docs.libresign.coop
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}