-
Notifications
You must be signed in to change notification settings - Fork 19
62 lines (62 loc) · 2.38 KB
/
compile.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
name: compilepaper
on: [push, pull_request]
jobs:
paper:
runs-on: ubuntu-latest
env:
DIR: .
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false # must be done manually
- name: Install pandoc
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
inkscape \
texlive texlive-latex-extra pandoc latexmk \
texlive-bibtex-extra biber \
texlive-fonts-recommended texlive-fonts-extra lmodern fonts-linuxlibertine \
python3 python3-yaml \
xz-utils make sed gpg-agent
python3 -m venv ${{ env.DIR }}/venv && source ${{ env.DIR }}/bin/activate
python3 -m pip install -r ${{ env.DIR }}/requirements.txt
# Workaround for https://github.com/tomduck/pandoc-xnos/pull/29
python3 -m pip install --force-reinstall git+https://github.com/tomduck/pandoc-xnos@284474574f51888be75603e7d1df667a0890504d#egg=pandoc-xnos
- name: Fetch bibliography
run : |
# resolve relative paths in forked projects
sed -i 's|^[ \t]*url *= *../| url = https://github.com/the-teachingRSE-project/|' .gitmodules
git submodule update --init --recursive
git config --local submodule.recurse true
- name: pandoc compile
working-directory: ${{ env.DIR }}
run: source ${{ env.DIR }}/venv/bin/activate && make all
- name: move
run: mkdir -p github_artifacts && mv ${{ env.DIR }}/*.pdf ./github_artifacts/
- name: Upload pdf as artifact
uses: actions/upload-artifact@v4
with:
name: PDF files
path: ./github_artifacts
deploy:
needs: [paper]
permissions:
contents: write
runs-on: ubuntu-latest
if: ${{ github.repository == 'the-teachingRSE-project/competencies' && github.ref == 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: github_artifacts
- name: move
run: mkdir -p github_deploy && mv github_artifacts/*/* github_deploy
- name: deploy on orphan branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./github_deploy
publish_branch: build
force_orphan: true