-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 2.1 KB
/
compile-legacy-nmdc-documentation.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
# This GitHub Actions workflow compiles the Sphinx documentation into web-based documentation.
# Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
name: Compile legacy NMDC documentation into HTML
on:
push: { branches: [ main ] }
workflow_dispatch: { }
# Allow this workflow to be called by other workflows.
# Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows
workflow_call: { }
jobs:
compile:
name: Compile
runs-on: ubuntu-latest
defaults:
run:
# Set a default working directory for all `run` steps in this job.
# Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun
working-directory: legacy/nmdc-documentation
permissions:
contents: read
steps:
- name: Check out commit # Docs: https://github.com/actions/checkout
uses: actions/checkout@v4
- name: Set up Python # Docs: https://github.com/actions/setup-python
uses: actions/setup-python@v5
with: { python-version: '3.12' }
- name: Install Sphinx # Docs: https://pypi.org/project/Sphinx/
run: pip install Sphinx
- name: Install other dependencies
run: pip install -r requirements.txt
- name: Compile source documents into HTML
run: sphinx-build -b html src ${{ github.workspace }}/legacy/nmdc-documentation/_build/html
# Upload the result as an "artifact" so it can then be downloaded and used by another job.
- name: Save the HTML for publishing later # Docs: https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v4
with:
name: legacy-nmdc-documentation-as-html
# Note: Relative `path` values here are relative to the _workspace_, not to the current working directory.
# Reference: https://github.com/actions/upload-artifact/pull/477#issue-2044900649
path: legacy/nmdc-documentation/_build/html
if-no-files-found: error
retention-days: 1 # Note: 1 day is the shortest period possible