Skip to content

Commit 6e719eb

Browse files
committed
Export PDFs to 'pdf' branch
1 parent 2a2c618 commit 6e719eb

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

.github/workflows/render.yml

+20-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
on:
22
push:
3+
paths:
4+
- '**.typ'
35
workflow_dispatch:
46
jobs:
57
compile:
@@ -8,11 +10,21 @@ jobs:
810
- uses: actions/checkout@v4
911
- uses: typst-community/setup-typst@v3
1012
- run: make compile
11-
- run: |
12-
git config --global user.name "github-actions[bot]"
13-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
14-
git add */*.pdf
15-
git commit -m "Add compiled PDF"
16-
git push
17-
env:
18-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
- name: Commit and Export to pdfs Branch
14+
run: |
15+
# Set up Git user
16+
git config --global user.name "github-actions"
17+
git config --global user.email "[email protected]"
18+
19+
# Create the 'pdfs' branch from the current repository state
20+
git checkout --orphan pdfs
21+
git reset --hard
22+
23+
# Add all files, including generated PDFs
24+
git add -A
25+
26+
# Commit changes
27+
git commit -m "Export PDFs to pdfs branch"
28+
29+
# Push to pdfs branch, force to overwrite previous branch contents
30+
git push --force origin pdfs

0 commit comments

Comments
 (0)