Skip to content

[preview] Migrate to quantecon/actions/preview-netlify - #336

Merged
mmcky merged 2 commits into
mainfrom
infra/migrate-preview-netlify
Jul 14, 2026
Merged

mmcky merged 2 commits into
mainfrom
infra/migrate-preview-netlify

Conversation

@mmcky

@mmcky mmcky commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This adopts the org-standard preview action and removes a redundant, racing Netlify deploy.

What

ci.yml — migrate to the org action. Replaces the third-party nwtgck/actions-netlify@v4 with quantecon/actions/preview-netlify@v0.8.0 — the same version already used in lecture-python.myst. A setup-node step is added because the action installs the Netlify CLI via npm. Inputs move to netlify-auth-token / netlify-site-id / build-dir; lectures-dir defaults to lectures, which matches this repo.

collab.yml — drop the redundant preview deploy. The execution-checks job exists to test execution on the Colab runtime image. It was also deploying _build/html/ to the same Netlify site as ci.yml, so the two jobs raced for the PR alias — and the Colab build omits the notebook and PDF download assets, so when it won the race the published preview was a degraded version. ci.yml now owns the single canonical preview.

Why the new action is better

  • Deploys via the Netlify CLI (tooling QuantEcon owns and versions) to a deterministic pr-<number> alias instead of racing on Netlify’s deploy-preview-<number>.
  • Posts one self-updating PR comment (edits in place instead of stacking a new comment per push) with direct links to the changed lecture pages.
  • Safely skips dependabot and fork PRs that cannot access secrets, so those runs no longer fail on the deploy step.

Verification

Both workflow files validate as well-formed YAML locally. The real exercise is a live PR run: the preview job builds on the GPU runner and deploys, so this PR itself is the end-to-end test — check that a single 📖 Netlify Preview Ready! comment appears and that the changed-page links resolve.

Follow-up (dashboard, not in this repo)

The netlify[bot] native Deploy Preview is configured in the Netlify dashboard, not here, so it is unaffected by this change. To avoid two preview comments, disable Netlify’s automatic Deploy Previews in the site settings so this GitHub Actions preview is the only one.

🤖 Generated with Claude Code

Replace the third-party nwtgck/actions-netlify deploy with the org's own
composite action quantecon/actions/preview-netlify@v0.8.0 (the same pin
used in lecture-python.myst). It deploys via the Netlify CLI to a
deterministic pr-<number> alias, posts a single self-updating PR comment
with direct links to the changed lecture pages, and safely skips
dependabot/fork PRs that can't access secrets. Requires a Node.js setup
step, added before it.

Also drop the redundant Preview Deploy step from collab.yml: that job's
purpose is execution testing on the Colab runtime, and its second deploy
to the same Netlify site raced ci.yml for the PR alias (and published a
lesser build with no notebook/PDF assets). ci.yml now owns the single
canonical preview.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 13, 2026 23:54
@netlify

netlify Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploy Preview for incomparable-parfait-2417f8 ready!

Name Link
🔨 Latest commit ea509dd
🔍 Latest deploy log https://app.netlify.com/projects/incomparable-parfait-2417f8/deploys/6a557ab1ebc2080008b5554b
😎 Deploy Preview https://deploy-preview-336--incomparable-parfait-2417f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the repository’s PR preview deployment to the organization-standard Netlify preview action and removes a redundant Netlify deploy from the Colab execution workflow to prevent racing/overwriting PR previews.

Changes:

  • Replace nwtgck/actions-netlify@v4 with quantecon/actions/preview-netlify@v0.8.0 in the main preview workflow and add a Node setup step.
  • Remove the Netlify deploy step from the Colab execution-checks workflow to avoid racing deployments to the same site/alias.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/ci.yml Switches preview deployment to quantecon/actions/preview-netlify and installs Node for the Netlify CLI dependency.
.github/workflows/collab.yml Removes redundant Netlify preview deploy to eliminate PR preview alias races and degraded previews.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-336--incomparable-parfait-2417f8.netlify.app

Commit: 883600b


Build Info

The preview-netlify action posts/updates the preview comment via
actions/github-script, which needs a write-scoped GITHUB_TOKEN. Without an
explicit permissions block the job inherits the org default, which 403s
under read-only tokens. Mirror lecture-python.myst: contents: read +
pull-requests: write.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mmcky
mmcky merged commit 803c701 into main Jul 14, 2026
2 checks passed
@mmcky
mmcky deleted the infra/migrate-preview-netlify branch July 14, 2026 04:28
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.

2 participants