add bsc and msc collections #113
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
jobs: | |
documents: | |
name: Collect Documents | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: . | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Determine Scope | |
id: scope | |
run: "[[ '${{ github.event_name }}' == 'workflow_dispatch' ]] && echo 'scope=all' >>$GITHUB_OUTPUT || echo 'scope=changed' >>$GITHUB_OUTPUT" | |
- name: Collect Documents | |
id: documents | |
run: .github/collect-documents.sh ${{ steps.scope.outputs.scope }} | |
outputs: | |
documents: ${{ steps.documents.outputs.documents }} | |
build: | |
name: Build Document | |
runs-on: ubuntu-22.04 | |
needs: documents | |
if: needs.documents.outputs.documents != '[]' | |
defaults: | |
run: | |
working-directory: . | |
strategy: | |
matrix: | |
document: ${{ fromJSON(needs.documents.outputs.documents) }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Graphviz, Imagamagick and Spin | |
run: | | |
sudo apt update | |
sudo apt install -y graphviz spin imagemagick ghostscript | |
- name: Change ImageMagick security policy | |
run: | | |
DQT='"' | |
SRC="rights=${DQT}none${DQT} pattern=${DQT}PDF${DQT}" | |
RPL="rights=${DQT}read\|write${DQT} pattern=${DQT}PDF${DQT}" | |
sudo sed -i "s/$SRC/$RPL/" /etc/ImageMagick-6/policy.xml | |
- name: Install TeXLive | |
run: sudo apt install -y texlive-base texlive-fonts-extra texlive-humanities texlive-lang-cyrillic texlive-lang-english texlive-lang-german texlive-latex-extra texlive-latex-recommended texlive-latex-recommended texlive-luatex texlive-pictures texlive-plain-generic texlive-publishers texlive-science | |
- name: install additional latex-packages | |
run: | | |
mkdir -p setup/latex/darkmode-latex-package | |
git clone https://github.com/Rdeisenroth/darkmode-latex-package.git setup/latex/darkmode-latex-package | |
cd setup/latex/darkmode-latex-package | |
l3build install | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
cache: pip | |
- name: Install Python Dependencies | |
run: "pip install -f https://download.pytorch.org/whl/torch_stable.html -r sys/requirements.txt" | |
- name: Build Document (Light Mode) | |
id: build-light | |
run: .github/build-document.sh ${{ matrix.document }} | |
- name: Upload Artifact (Light Mode) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.document }} | |
path: ${{ steps.build-light.outputs.artifact_path }} | |
- name: Build Document (Dark Mode) | |
id: build-dark | |
run: .github/build-document.sh ${{ matrix.document }} | |
env: | |
DARK_MODE: 1 | |
- name: Upload Artifact (Dark Mode) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.document }} dark | |
path: ${{ steps.build-dark.outputs.artifact_path }} | |
publish: | |
name: Publish Documents | |
runs-on: ubuntu-22.04 | |
needs: | |
- documents | |
- build | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
- name: Fix Document Paths | |
run: ".github/move-documents.sh '${{ needs.documents.outputs.documents }}'" | |
- name: Publish Documents | |
run: ".github/publish-documents.sh" | |
env: | |
gh_user: ${{ secrets.PUBLISH_GH_USER }} | |
gh_token: ${{ secrets.PUBLISH_GH_TOKEN }} |