Skip to content

A reusable workflow that deploys a release to GitHub Pages, and redeploys an earlier one to roll back #355

In review

Description

@mmcky

After its cutover, a series' repository receives its site as a release that QuantEcon/lectures creates there (QuantEcon/project-monorepo#78, and #354 for publish-gh-pages). It then needs a workflow that does two things:

  • On release: published for a publish-* tag, deploy that release's site to GitHub Pages.
  • On a dispatch with an earlier tag, deploy that release again, which is the rollback.

templates/restore.yml already does the second with restore-gh-pages and publish-gh-pages. The owner ruled on 2026-10-06 (QuantEcon/project-monorepo#78) that this is one reusable workflow in this repository, called from a thin file in each series' repository, so that a change lands once. Matt approved the design on 2026-11-26, relayed by the organiser session, as "Approve, with the refinements". The points below include them.

Proposed: a reusable workflow (workflow_call) and a caller template.

  • Inputs: tag (empty by default: the triggering release's tag) and asset-name (empty by default, as in restore-gh-pages).
  • The trigger filter. On a release event, the job runs only if: startsWith(github.event.release.tag_name, 'publish-').
  • No two deploys at once. concurrency: pages, with cancel-in-progress: false, the group publish.yml and restore.yml use.
  • The deploy. restore-gh-pages at the tag, then publish-gh-pages with mode: upload and mode: deploy split, in the github-pages environment. The permissions are contents: read, pages: write and id-token: write. It runs no repository code. The release event's ref is refs/tags/publish-…, which the series' Pages environments already admit, as they admit main for a dispatch.
  • The notebooks push (from the release's _notebooks/, for the series that serve Colab from a .notebooks repository) runs in a job of its own, with its own secret, never in the Pages job. It's optional.
  • A caller template in templates/: release: published plus workflow_dispatch with a tag, with a one-line comment saying what it does and where the workflow lives. It joins canary-watch's drift check.

It needs a canary proof before v0 moves. Its first real caller is QuantEcon/test-lecture-dp, the dp test double, in the publishing rehearsal (QuantEcon/project-monorepo#27). One pull request, with the chapter, a harness job, a CHANGELOG entry and a staged release. I'll open it, and it goes through this repository's review.

🤖 Generated with Claude Code

Activity

  1. added
    enhancement
    on Nov 26, 2026
  2. mmcky commented on Nov 26, 2026

    @mmcky
    ContributorAuthor

    The pull request is #357. As agreed in review, it ships the deploy and the rollback only. The notebooks push, which this request listed as optional, is deferred to #356, until Matt has settled whether a companion repository is mirrored or copied over. The canary drift-check entry for the new template follows in the post-move pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions