Skip to content

Commit 403c0e7

Browse files
committed
Setup CI for PDF rendering
1 parent 379011e commit 403c0e7

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,78 @@ jobs:
9292

9393
- name: Run clippy
9494
run: cargo clippy --workspace --tests
95+
96+
build-pdf:
97+
name: Build PDFs
98+
runs-on: ubuntu-latest
99+
steps:
100+
- name: Checkout
101+
uses: actions/checkout@v4
102+
103+
- name: Setup Fontist
104+
uses: fontist/setup-fontist@v2
105+
with:
106+
fontist-version: "^1.21"
107+
108+
- name: Install fonts
109+
run: fontist install "Libertinus Sans"
110+
111+
- name: Setup Typst
112+
uses: typst-community/setup-typst@v4
113+
with:
114+
typst-version: ^0.14
115+
116+
- name: Show Typst version
117+
run: typst --version
118+
119+
- name: List available fonts
120+
run: typst fonts --font-path ~/.fontist/fonts
121+
122+
- name: Compile guide on BDDs
123+
working-directory: docs/guide
124+
run: typst compile --font-path ~/.fontist/fonts main.typ guide-bdd.pdf
125+
126+
- name: Compile guide on Abstract Interpretation
127+
working-directory: examples/abstract-interpretation/guide
128+
run: typst compile --font-path ~/.fontist/fonts main.typ guide-ai.pdf
129+
130+
- name: Upload PDFs as artifact
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: pdf
134+
path: |
135+
docs/guide/guide-bdd.pdf
136+
examples/abstract-interpretation/guide/guide-ai.pdf
137+
138+
deploy:
139+
runs-on: ubuntu-latest
140+
needs: [build-pdf]
141+
concurrency:
142+
group: "pages"
143+
cancel-in-progress: false
144+
steps:
145+
- name: Checkout code
146+
uses: actions/checkout@v4
147+
148+
- name: Download all artifacts
149+
uses: actions/download-artifact@v5
150+
with:
151+
pattern: "*"
152+
153+
- name: Show downloaded files
154+
run: ls -R
155+
156+
- name: Prepare files for gh-pages
157+
run: |
158+
# Create public directory
159+
mkdir -p public
160+
161+
# Copy all Typst PDFs
162+
cp pdf/*.pdf public/
163+
164+
- name: Deploy
165+
uses: peaceiris/actions-gh-pages@v4
166+
with:
167+
github_token: ${{ secrets.GITHUB_TOKEN }}
168+
publish_dir: ./public
169+
force_orphan: true

0 commit comments

Comments
 (0)