-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (63 loc) · 2.01 KB
/
render_on_push.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
76
name: Render
on:
push:
branches:
- "**"
jobs:
render:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: "Fix cache permissions"
run: |
sudo chmod aoug+rw -R /var/cache/apt
- name: Cache apt package lists and downloaded deb files
uses: actions/cache@v3
with:
path: |
/var/cache/apt/archives/**.deb
!/var/cache/apt/archives/partial
!/var/cache/apt/archives/lock
key: apt-packages-cache
restore-keys: |
${{ runner.os }}-apt
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc inkscape texlive-latex-base texlive-fonts-extra texlive-extra-utils poppler-utils
- name: Run the PDF rendering script in the renderer folder
run: make
working-directory: renderer
- name: Upload PDF files as an artifact
uses: actions/upload-artifact@v4
with:
name: booklet
path: renderer/*.pdf
release:
needs: render
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Download PDF artifacts
uses: actions/download-artifact@v4
with:
name: booklet
path: ./renderer
- name: List downloaded PDF files
run: ls -la ./renderer
- name: Get current date
id: current_date
run: echo "current_date=$(date +'%y%m%d%H%M')" >> $GITHUB_ENV
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v1
with:
tag_name: release-${{ env.current_date }}
name: Release - ${{ env.current_date }}
body: |
This release was generated automatically upon a successful merge (new article added).
files: ./renderer/*.pdf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}