Skip to content

Commit 44b6a65

Browse files
authored
Add documentation artifacts to Actions (#67)
1 parent 775cd8e commit 44b6a65

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ jobs:
2222
# a pull request then we can checkout the head.
2323
fetch-depth: 2
2424

25-
# If this run was triggered by a pull request event, then checkout
26-
# the head of the pull request instead of the merge commit.
27-
- run: git checkout HEAD^2
28-
if: ${{ github.event_name == 'pull_request' }}
29-
3025
# Initializes the CodeQL tools for scanning.
3126
- name: Initialize CodeQL
3227
uses: github/codeql-action/init@v1

.github/workflows/documentation.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
name: Documentation check
23

34
on: [pull_request]
@@ -28,3 +29,28 @@ jobs:
2829
pip install -e .
2930
- name: Build ${{ matrix.doc-type }} documentation
3031
run: sphinx-build -Wnb ${{ matrix.doc-type }} docs/source/ docs/build-${{ matrix.doc-type }}/
32+
33+
- name: Prepare documentation artifact
34+
run: |
35+
# Define Path to Upload
36+
if [ "${{ matrix.doc-type }}" = html ]; then echo "art_path=docs/build-html" >> $GITHUB_ENV; fi
37+
if [ "${{ matrix.doc-type }}" = latex ]; then echo "art_path=docs/build-latex/MicroStructPy.pdf" >> $GITHUB_ENV; fi
38+
if [ "${{ matrix.doc-type }}" = epub ]; then echo "art_path=docs/build-epub/MicroStructPy.epub" >> $GITHUB_ENV; fi
39+
40+
# Build PDF
41+
if [ "${{ matrix.doc-type }}" = latex ]; then sudo apt install texlive-fonts-recommended; fi
42+
if [ "${{ matrix.doc-type }}" = latex ]; then sudo apt install texlive-latex-recommended; fi
43+
if [ "${{ matrix.doc-type }}" = latex ]; then sudo apt install texlive-lang-english; fi
44+
if [ "${{ matrix.doc-type }}" = latex ]; then sudo apt install texlive-xetex; fi
45+
if [ "${{ matrix.doc-type }}" = latex ]; then sudo apt install latexmk; fi
46+
if [ "${{ matrix.doc-type }}" = latex ]; then cd docs/build-latex; fi
47+
if [ "${{ matrix.doc-type }}" = latex ]; then make; fi
48+
if [ "${{ matrix.doc-type }}" = latex ]; then cd -; fi
49+
50+
51+
- name: Upload artifact
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: microstructpy_${{ matrix.doc-type }}_documentation
55+
path: ${{ env.art_path }}
56+

0 commit comments

Comments
 (0)