Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6fbe712
Add Monthly Updates page under Goal Trackers
Alex-Zughaid Jul 29, 2026
c7dcad5
Revert "Add Monthly Updates page under Goal Trackers"
Alex-Zughaid Jul 30, 2026
7f9eb16
monthly updates
Alex-Zughaid Jul 30, 2026
37f9364
generated new report
Alex-Zughaid Aug 10, 2026
c1e6920
...
Alex-Zughaid Aug 10, 2026
050f1ac
feat(monthly-updates): split contributors/reviewers, fix PDF renderin…
Alex-Zughaid Aug 12, 2026
9819c49
fix(monthly-updates): make failures fail, harden API and workflow
Alex-Zughaid Aug 12, 2026
0209bf0
feat(monthly-updates): fix docstring typography and rework the front …
Alex-Zughaid Aug 12, 2026
fa6d69e
Final draft of PDF
Alex-Zughaid Aug 12, 2026
b27a84b
Merge branch 'main' of https://github.com/Alex-Zughaid/physlib-website
Alex-Zughaid Aug 12, 2026
599fa7d
reworked layout
Alex-Zughaid Aug 12, 2026
61de309
Merge branch 'main' into feat-monthly-status-update
Alex-Zughaid Aug 12, 2026
3b7c543
Squashed commit of the following:
Alex-Zughaid Aug 12, 2026
1890b53
added sidebar for other pages
Alex-Zughaid Aug 12, 2026
b1b353b
Merge branch 'website-layout-rework' into feat-monthly-status-update
Alex-Zughaid Aug 12, 2026
7189f0f
changed layout of page
Alex-Zughaid Aug 12, 2026
a32347d
fix(graphviz): dedupe script loads by real completion, not DOM presence
Alex-Zughaid Aug 12, 2026
c880137
Merge branch 'website-layout-rework' into feat-monthly-status-update
Alex-Zughaid Aug 12, 2026
16303ba
pdf viewer within page
Alex-Zughaid Aug 12, 2026
536c57b
changed layout and added pdf viewer
Alex-Zughaid Aug 13, 2026
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
159 changes: 159 additions & 0 deletions .github/workflows/monthly-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Generate monthly update

on:
schedule:
# Runs at 03:15 UTC on the 1st of every month. Uses the UTC clock so the
# "previous month" that the script picks matches the calendar month that
# just ended.
- cron: "15 3 1 * *"
workflow_dispatch:
inputs:
month:
description: "Optional YYYY-MM to generate (default: previous month)"
required: false
type: string
backfill:
description: "Optional number of previous months to backfill"
required: false
type: string
force:
description: "Overwrite existing JSON files"
required: false
type: boolean
default: false

permissions:
contents: write

# Two runs committing to the same branch would race on push.
concurrency:
group: monthly-updates
cancel-in-progress: false

jobs:
generate:
runs-on: ubuntu-latest
# A month whose clone hangs or whose compile pathologically loops would
# otherwise sit here for the 6-hour default.
timeout-minutes: 60
env:
# The `secrets` context is not available to a step's `if`, so the
# presence of the mirror credential is hoisted here as a plain boolean.
# Deliberately not the secret itself: this keeps it out of every step's
# environment.
HAS_MIRROR_PAT: ${{ secrets.MIRROR_PAT != '' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: true
# The commit step below rebases onto whatever landed on the branch
# while TeX was installing, and rebasing in a depth-1 clone fails as
# soon as the remote has moved more than that one commit.
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

# Pinned to a commit, not a tag: this step runs in a job holding
# `contents: write` and MIRROR_PAT, and a mutable tag is re-pointable by
# its owner at any time. Bump deliberately, not implicitly.
- name: Install Tectonic (LaTeX engine)
uses: wtfjoke/setup-tectonic@8a63d072f8390efdff59da7fa08aa49e3c1f5e1b # v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# The generator reads whole Lean files at both month-boundary commits, so
# it needs a clone of physlib. Caching it turns a full clone into a small
# incremental fetch on subsequent runs.
- name: Cache physlib clone
uses: actions/cache@v4
with:
path: web2/.cache/physlib.git
key: physlib-clone-${{ github.run_id }}
restore-keys: physlib-clone-

# Inputs go through env, never string-interpolated into the script: a
# `${{ inputs.month }}` spliced straight into `run:` lets a dispatch value
# like `2026-01; curl … | sh` execute as shell.
- name: Run generator
working-directory: web2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MONTH: ${{ inputs.month }}
BACKFILL: ${{ inputs.backfill }}
FORCE: ${{ inputs.force }}
run: |
ARGS=()
if [ -n "$MONTH" ]; then
ARGS+=(--month "$MONTH")
fi
if [ -n "$BACKFILL" ]; then
ARGS+=(--backfill "$BACKFILL")
fi
if [ "$FORCE" = "true" ]; then
ARGS+=(--force)
fi
node scripts/generate-monthly-updates.js "${ARGS[@]}"

# The .tex and the salvaged .log live only on the runner - both are
# gitignored - so without this a CI-only compile failure leaves nothing
# to debug from but a truncated stdout tail.
- name: Upload LaTeX build directory on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: monthly-updates-latex-${{ github.run_id }}
path: web2/.monthly-updates-build/
if-no-files-found: ignore
retention-days: 14

# Only the JSON and the PDF are published. The .tex intermediate lives in
# web2/.monthly-updates-build/ and is gitignored.
- name: Commit & push new report(s)
id: commit
env:
MONTH: ${{ inputs.month }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add web2/data/monthly-updates web2/public/monthly-updates
if git diff --cached --quiet; then
echo "No new monthly reports to commit."
echo "committed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
MSG="chore(monthly-updates): auto-generated report"
if [ -n "$MONTH" ]; then
MSG="$MSG for $MONTH"
fi
git commit -m "$MSG"
# main may have moved while TeX was installing.
git pull --rebase --autostash origin "${GITHUB_REF_NAME}"
git push origin "HEAD:${GITHUB_REF_NAME}"
echo "committed=true" >> "$GITHUB_OUTPUT"

# The site deploys via Gabrielebattimelli/Physlib-Website (Vercel), which
# mirror-to-personal.yml normally keeps in sync on push. That workflow
# will NOT fire for the commit above: GitHub deliberately does not trigger
# workflows for pushes made with the default GITHUB_TOKEN, to avoid
# recursion. Without this step the report lands on main and never reaches
# the live site. So mirror it here, using the same secret and target as
# mirror-to-personal.yml.
#
# Guarded on the secret being present: without it this fails with an
# opaque git credential error, and it fails *after* the report has
# already been committed and pushed to this repo, which reads as "the
# run broke" rather than "the mirror isn't configured".
- name: Mirror to personal repo (Vercel)
if: steps.commit.outputs.committed == 'true' && env.HAS_MIRROR_PAT == 'true'
env:
MIRROR_PAT: ${{ secrets.MIRROR_PAT }}
run: |
git config --unset-all http.https://github.com/.extraheader || true
git config --global credential.helper store
echo "https://x-access-token:${MIRROR_PAT}@github.com" > ~/.git-credentials
git remote add mirror https://github.com/Gabrielebattimelli/Physlib-Website.git
git push mirror "HEAD:refs/heads/${GITHUB_REF_NAME}"
6 changes: 6 additions & 0 deletions web2/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# monthly-updates generator intermediates. Only data/monthly-updates/*.json and
# public/monthly-updates/*.pdf are committed.
/.monthly-updates-build/
/.cache/
/build.log
Loading