generated from NASA-PDS/template-repo-java
-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (83 loc) · 2.74 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
97
98
99
100
101
102
103
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
---
name: Build Sphinx Docs
on:
push:
branches:
- 'TBD' # Cannot build these docs on main right now.
paths:
- 'docs/**'
jobs:
build: # job 1
name: 'Build Website Docs'
runs-on: ubuntu-latest
environment: github-pages
if: github.actor != 'pdsen-ci'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
#- name: Set up Python 3
# uses: actions/setup-python@v1
# with:
# python-version: '3.9'
- name: Install Python and dependencies
run: |
sudo apt-get install python3.9
pip install -e '.[dev]'
- name: Build the Docs
id: make
run: |
sphinx-build -b html docs/source docs/build
- name: Commit Doc Updates
run: |
git config --local user.email "[email protected]"
git config --local user.name "PDSEN CI Bot"
git add -A .
git commit --allow-empty -m "Auto-generated docs by PDSEN CI Bot"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
branch: gh-pages
force: true
pdfgen: # job 1
name: 'Build PDF'
runs-on: ubuntu-latest
environment: main
if: github.actor != 'pdsen-ci'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
#- name: Set up Python 3
# uses: actions/setup-python@v1
# with:
# python-version: '3.9'
- name: Install Python and Dependencies
run: |
# Install Python
sudo apt-get install python3.9
# Install Sphinx
pip install -r docs/requirements.txt
# Install dependencies for PDF generation
sudo apt install texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra latexmk
- name: Make Sphinx
id: make
run: |
cd docs
make latexpdf
cp build/latex/*.pdf .
- name: Push LDDs to Github
run: |
git config --local user.email "[email protected]"
git config --local user.name "PDSEN CI Bot"
git add -A ./*.pdf
git commit --allow-empty -m "Auto-gen PDF by PDSEN CI Bot"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
branch: main
force: true