-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (72 loc) · 2.7 KB
/
documentation.yaml
File metadata and controls
83 lines (72 loc) · 2.7 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
---
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 The Linux Foundation <https://linuxfoundation.org>
name: "📰 Publish Documentation"
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
pull_request:
types: [closed]
branches:
- "main"
- "master"
- "!update-devops-tooling"
paths:
- "!.github"
permissions: {}
jobs:
build_and_deploy:
name: "Rebuild documentation"
runs-on: "ubuntu-24.04"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
# IMPORTANT: mandatory for documentation updates; used in final step
contents: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Checkout Repository"
# yamllint disable-line rule:line-length
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: "Set up Python"
# yamllint disable-line rule:line-length
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: "3.11"
- name: "Check documentation dependencies"
id: docs-requirements
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/path-check-action@99bda8267c7e1a71fe02f79698ca1061a48e4c8e # 2024-12-31
with:
path: "docs/requirements.txt"
- name: "Check for TOX configuration"
id: tox-ini
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/path-check-action@99bda8267c7e1a71fe02f79698ca1061a48e4c8e # 2024-12-31
with:
path: "tox.ini"
- name: "Install documentation dependencies"
if: steps.docs-requirements.outputs.type == 'file'
run: |
# Install documentation dependencies
echo "Installing documentation dependencies"
pip --disable-pip-version-check install -r docs/requirements.txt
echo "Documentation dependencies installed ✅"
- name: "Build documentation (tox/sphinx)"
if: steps.tox-ini.outputs.type == 'file'
run: |
# Build documentation (tox/sphinx)
pip --disable-pip-version-check install --upgrade tox
tox -e docs
echo "Tox documentation build ✅"
- name: "Publish documentation"
if: success()
# yamllint disable-line rule:line-length
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
publish_branch: gh-pages
# github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ github.token }}
publish_dir: docs/_build/html/
keep_files: true