-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (43 loc) · 1.32 KB
/
build-pdf-commit.yml
File metadata and controls
54 lines (43 loc) · 1.32 KB
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
name: Build and Commit PDFs
on:
push:
branches:
- '**'
- '!dependabot/**'
- '!renovate/**'
paths-ignore:
- 'dist/pdf/**'
permissions:
contents: write
jobs:
build-pdf:
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Typst
run: |
curl -sL https://github.com/typst/typst/releases/download/v0.14.2/typst-x86_64-unknown-linux-musl.tar.xz \
| tar -xJ -C "$HOME/.local/bin" --strip-components=1 typst-x86_64-unknown-linux-musl/typst
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Build PDFs
run: npm run build:pdf:typst
- name: Commit generated PDFs
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add dist/pdf
if git diff --cached --quiet; then
echo "No PDF changes to commit"
exit 0
fi
git commit -m "chore(pdf): update generated PDFs [skip ci]"
git push