Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/writeup-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build and Deploy Writeup

on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build-writeup:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Typst
uses: typst-community/setup-typst@v4

- name: Build PDF
run: |
mkdir -p site
typst compile --root . WriteUp/main.typ site/main.pdf

- name: Add index page
run: |
cat > site/index.html <<'HTML'
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>PNN_S Write-up</title>
<style>
body { margin: 0; font-family: system-ui, sans-serif; }
object { width: 100vw; height: 100vh; border: 0; }
</style>
</head>
<body>
<object data="main.pdf" type="application/pdf">
<p>Open the write-up: <a href="main.pdf">main.pdf</a></p>
</object>
</body>
</html>
HTML

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
needs: build-writeup
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading