forked from ntu-student-congress/tortue
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.45 KB
/
genpdf.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
name: Generate PDF
on:
push:
branches:
- main
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Setup LaTeX
run: sudo apt-get -qq update
- run: sudo apt-get -y --no-install-recommends install texlive-full
- name: Setup Fonts
run: sudo apt-get -y install xfonts-utils
- run: sudo mkdir -p /usr/share/fonts/truetype/
- run: sudo cp fonts/* /usr/share/fonts/truetype/
- run: sudo mkfontscale
- run: sudo mkfontdir
- run: sudo fc-cache -f
- name: Generate .tex document
run: node gen.js 1
- name: Generate PDF File
run: seq 2 | xargs -I{} xelatex final.tex -interaction=nonstopmode -halt-on-error
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v.${{ github.sha }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./final.pdf
asset_name: statute.pdf
asset_content_type: application/pdf