-
Notifications
You must be signed in to change notification settings - Fork 47
73 lines (70 loc) · 2.48 KB
/
build-docs.yaml
File metadata and controls
73 lines (70 loc) · 2.48 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
name: "Build docs"
on:
workflow_call:
inputs:
ref:
description: "the git revision to checkout"
default: ${{ github.ref }}
required: false
type: string
skip-devcontainer:
description: "True will skip the build of the devcontainer"
default: false
required: false
type: boolean
secrets:
ARTIFACTS_USER:
required: true
ARTIFACTS_PASSWORD:
required: true
jobs:
build-devcontainer:
uses: ./.github/workflows/build-devcontainer.yaml
secrets: inherit
with:
# NOTE: We check "== true" instead of just checking the value
# since by default when the workflow is call with "workflow dispatch"
# the input will (sadly) be "" and not use the default value
skip: ${{ inputs.skip-devcontainer == true }}
docs:
runs-on: ubuntu-latest
needs:
- build-devcontainer
container:
image: ghcr.io/${{ github.repository }}/devcontainer:${{ github.sha }}
# We have to use `root` for the moment
# Sees: https://github.com/actions/checkout/issues/1575
# Could work with a user with 1001 id but not for docker
options: --user root
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- name: Set safe directory (since container is root and not user 1001)
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Build documentation for ReadTheDocs
env:
# Fake that we are building in a ReadTheDocs environment
READTHEDOCS: "True"
run: tox --workdir /tmp/tox -e docs -- html
- name: Copy generated docs for ReadTheDocs
run: mkdir -p artifacts/docs/readthedocs && cp -r docs/_build/* artifacts/docs/readthedocs/
- name: Build documentation with Scality theme
run: rm -rf docs/_build && tox --workdir /tmp/tox -e docs -- html
- name: Copy generated docs with Scality theme
run: cp -r docs/_build/* artifacts/docs/ && cp CHANGELOG.md artifacts/docs/
- name: Upload artifacts
uses: scality/action-artifacts@v4
with:
method: upload
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: artifacts