Skip to content

Add GitHub Actions workflow to build PDFs with decktape#14

Merged
lsetiawan merged 12 commits into
stagingfrom
add-pdf-build-workflow
May 15, 2026
Merged

Add GitHub Actions workflow to build PDFs with decktape#14
lsetiawan merged 12 commits into
stagingfrom
add-pdf-build-workflow

Conversation

@lsetiawan

Copy link
Copy Markdown
Member

Summary

Adds .github/workflows/build-pdf.yml: on every push to main that touches security-in-age-of-ai/, build a PDF of the Reveal.js deck with decktape and commit it back to the same directory. The PDF is also uploaded as a workflow artifact for the run.

Mirrors the deck's own recommendations:

  • permissions: {} at workflow level, per-job opt-in
  • Pinned tool version ([email protected])
  • Serves the repo over HTTP locally so reveal.js's print-pdf mode works correctly

Test plan

  • Merge to main; verify the workflow runs and produces security-in-age-of-ai/security-in-age-of-ai.pdf
  • Trigger manually via workflow_dispatch to rebuild on demand

lsetiawan added 2 commits May 15, 2026 10:37
On every push to main that touches security-in-age-of-ai/, build a PDF
from the Reveal.js deck using decktape and commit it back to the same
directory. PDF is also uploaded as a workflow artifact.
Pin to full 40-char commit SHAs with tag comment, matching the deck's
own guidance on hijack-resistant action references.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 15, 2026

Copy link
Copy Markdown

Deploying presentations with  Cloudflare Pages  Cloudflare Pages

Latest commit: dbaddb8
Status: ✅  Deploy successful!
Preview URL: https://1df4b9f6.presentations-73a.pages.dev
Branch Preview URL: https://add-pdf-build-workflow.presentations-73a.pages.dev

View logs

lsetiawan added 8 commits May 15, 2026 11:11
Install decktape from astefanutti/decktape at commit 6735cec (v3.12.0)
so a retagged release on GitHub or npm can't substitute different code.
Enable pnpm via Corepack and switch decktape install + http-server /
wait-on invocations from npm/npx to pnpm / pnpm dlx.
- build: read-only permissions, runs on every PR and push to verify the
  deck still renders to PDF; uploads PDF as a workflow artifact.
- publish: gated by 'push to main', needs: build. Downloads the verified
  artifact and commits it back. Never sees source or runs build code.

Mirrors the same two-job split the deck recommends for release pipelines.
Set PNPM_HOME and add it to PATH so 'pnpm add -g' has a valid global
bin directory. Without this, pnpm errors with ERR_PNPM_NO_GLOBAL_BIN_DIR.
GitHub-hosted Ubuntu runners can't use Chrome's SUID sandbox, so
puppeteer fails with 'No usable sandbox'. Disabling it is safe inside
the ephemeral runner.
- New scripts/zenodo_publish.py uploads the PDF to the uw-ssec
  community on zenodo.org (or sandbox.zenodo.org when ZENODO_SANDBOX
  is set). First run creates a new deposition; later runs open a new
  version of the existing record and replace the file. Existing
  records are discovered by searching the authenticated user's
  depositions for a unique 'uw-ssec-deck:<slug>' keyword tag.
- Per-deck metadata lives in <deck>/zenodo.json so adding another
  deck is just adding a JSON file plus a publish step.
- Workflow publish job no longer commits; runs the script with
  ZENODO_TOKEN from secrets, defaults to sandbox so production
  records aren't created until ZENODO_SANDBOX repo var is set to
  'false'.
- Skips publish when the existing record's version already matches
  github.sha.
Replaces the git-SHA version with a calendar version computed at
publish time in UTC. When more than one publish happens on the same
day, the version becomes YYYY.MM.DD.N with N incremented from the
previous record's version.
- Workflow now also triggers on push to 'staging'.
- The publish job runs on either main or staging, but selects the
  Zenodo host and token based on which branch fired:
    staging  → sandbox.zenodo.org via ZENODO_SANDBOX_TOKEN
    main     → zenodo.org via ZENODO_TOKEN
- Drops the vars.ZENODO_SANDBOX override; branch decides.
@lsetiawan
lsetiawan changed the base branch from main to staging May 15, 2026 18:51
lsetiawan added 2 commits May 15, 2026 12:00
Lets each deck pick its own community without editing the script.
Defaults to 'uw-ssec' when unset.
@lsetiawan
lsetiawan merged commit f70e93a into staging May 15, 2026
4 checks passed
@lsetiawan
lsetiawan deleted the add-pdf-build-workflow branch May 15, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant