This repository was archived by the owner on Jan 31, 2021. It is now read-only.
generated from PoisotLab/manuscript-template
-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (73 loc) · 2.72 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
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Compile the document
on:
push:
branches:
- master
jobs:
dependencies:
name: Build the manuscript
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6]
steps:
- uses: actions/checkout@v2
- name: Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Set variables
shell: bash
run: |
echo ::set-env name=repo_name::$(echo ${{ github.repository }} | cut -d/ -f2)
- name: Download and install pandoc
run: |
wget https://github.com/jgm/pandoc/releases/download/2.9.1.1/pandoc-2.9.1.1-1-amd64.deb
sudo dpkg -i pandoc-2.9.1.1-1-amd64.deb
rm pandoc-2.9.1.1-1-amd64.deb
- name: Install python filters
run: |
python -m pip install --upgrade pip
pip install -r .assets/requirements.txt
- name: Cleanup the bibliography
run: python .assets/scripts/bibliography.py
- name: Cleanup the affiliations
run: python .assets/scripts/affiliations.py
- name: Prepare the output
run: |
mkdir -p dist
cp -r figures dist/
cp references.json dist/
cp .assets/styles/style.less dist/
- name: Get the CSL file
run: wget -O style.csl https://raw.githubusercontent.com/citation-style-language/styles/master/cell-numeric.csl
- name: Build the website
run: pandoc manuscript.md -o dist/index.html --filter pandoc-xnos --bibliography=references.json --metadata-file=metadata.json --template=.assets/templates/github.html --metadata filename=${{ env.repo_name }}
- name: Build the tex file
run: pandoc manuscript.md -s -o dist/${{ env.repo_name }}.tex --filte pandoc-xnos --bibliography=references.json --metadata-file=metadata.json --template=.assets/templates/copyedit.tex --csl=style.csl
- name: File check
run: ls -lah dist/
- name: Build the pdf file
uses: xu-cheng/latex-action@master
with:
working_directory: dist
root_file: ${{ env.repo_name }}.tex
args: "-f -interaction=nonstopmode -pdf"
- name: Cleanup after PDF build
uses: xu-cheng/latex-action@master
with:
working_directory: dist
root_file: ${{ env.repo_name }}.tex
args: "-c"
- name: Save artifacts
if: always()
uses: actions/upload-artifact@master
with:
name: ${{ env.repo_name }}
path: dist
- name: "GitHub Pages deployment"
if: always()
uses: maxheld83/[email protected]
env:
BUILD_DIR: "dist/"
GH_PAT: ${{ secrets.ACCESS_TOKEN }}