-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaction.yml
41 lines (38 loc) · 1.35 KB
/
action.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
name: paper-maker
description: Automagically build LaTex manuscripts and push the latest PDF back to GitHub
on: push
branding:
icon: 'zap'
color: 'blue'
jobs:
build:
runs-on: ubuntu-latest
env:
MANUSCRIPT_PATH: paper/ms # exclude the '.tex' / '.pdf' extension!
LATEX: pdflatex -shell-escape
BIBTEX: bibtex
steps:
- uses: actions/checkout@v1
- name: Install texlive
run: |
sudo apt-get install texlive-publishers \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-recommended \
texlive-fonts-extra
- name: Build paper
run: |
cd ${MANUSCRIPT_PATH%/*}
${LATEX} ${MANUSCRIPT_PATH##*/}.tex
${BIBTEX} ${MANUSCRIPT_PATH##*/}.aux
${LATEX} ${MANUSCRIPT_PATH##*/}.tex
${LATEX} ${MANUSCRIPT_PATH##*/}.tex
- name: Push paper
run: |
git checkout --orphan ${GITHUB_REF##*/}-pdf
git rm -rf .github/
cd ${MANUSCRIPT_PATH%/*}
git rm -rf .
git add -f ${MANUSCRIPT_PATH##*/}.pdf
git -c user.name='paper-maker' -c user.email='paper-maker' commit -m "update pdf"
git push -q -f https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} ${GITHUB_REF##*/}-pdf