forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (84 loc) · 3.16 KB
/
build-docs.yml
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
---
name: Build Documentation
on:
workflow_call:
inputs:
salt-version:
type: string
required: true
description: The Salt version to set prior to building packages.
cache-seed:
required: true
type: string
description: Seed used to invalidate caches
jobs:
build:
name: Build
runs-on:
- self-hosted
- linux
- medium
- x86_64
strategy:
fail-fast: false
matrix:
docs-output:
- linkcheck
- spellcheck
- html
- epub
# - pdf
steps:
- uses: actions/checkout@v3
- name: Download Release Patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
uses: actions/download-artifact@v3
with:
name: salt-${{ inputs.salt-version }}.patch
- name: Get Python Version
id: get-python-version
uses: ./.github/actions/get-python-version
with:
python-binary: python3
- name: Setup Python Tools Scripts
id: python-tools-scripts
uses: ./.github/actions/setup-python-tools-scripts
- name: Configure Git
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools pkg configure-git
- name: Apply release patch
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
run: |
tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete
- name: Cache Python Tools Docs Virtualenv
id: tools-venvs-dependencies-cache
uses: actions/cache@v3
with:
path: .tools-venvs/docs
key: ${{ inputs.cache-seed }}|${{ github.workflow }}|${{ github.job }}|tools-venvs|${{ steps.python-tools-scripts.outputs.version }}|docs|${{ steps.get-python-version.outputs.version }}|${{ hashFiles('requirements/**/docs.txt') }}
- name: Prepare Docs Build
run: |
git clone https://gitlab.com/saltstack/open/docs/builddocs.git .builddocs
sudo mkdir -p /usr/share/fonts/truetype /usr/share/fonts/opentype
sudo cp -rfv .builddocs/builddocs/files/fonts/truetype/*.ttf /usr/share/fonts/truetype/
sudo cp -rfv .builddocs/builddocs/files/fonts/opentype/*.otf /usr/share/fonts/opentype/
sudo fc-cache -f -v
- name: Build Documentation (${{ matrix.docs-output }})
id: build-docs
shell: bash
continue-on-error: ${{ matrix.docs-output == 'linkcheck' || matrix.docs-output == 'spellcheck' }}
env:
LATEST_RELEASE: "${{ inputs.salt-version }}"
SALT_ON_SALTSTACK: "1"
ARCHIVE_FILENAME: "${{ format('salt-{0}-docs-{1}.tar.xz', inputs.salt-version, matrix.docs-output) }}"
run: |
tools docs ${{ matrix.docs-output }}
- name: Upload Built Documentation Artifact(${{ matrix.docs-output }})
if: ${{ steps.build-docs.outputs.has-artifacts == 'true' }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.build-docs.outputs.artifact-name }}
path: ${{ steps.build-docs.outputs.artifact-path }}
retention-days: 7
if-no-files-found: error