Skip to content

Add PR preview deploy — Netlify or Cloudflare? #24

Description

@mmcky

Part of #22.

ci.yml currently builds the site and uploads it as a workflow artifact — reviewers have to download and unzip to see a change. Every other lecture repo deploys a clickable PR preview.

Decision needed: Netlify or Cloudflare Pages?

  • Cloudflare Pages (suggested for this repo): free for public and private repos, predictable per-PR URLs (pr-N.<project>.pages.dev), supported by quantecon/actions/preview-cloudflare@v0.6.0. Needs a Pages project + CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID secrets.
  • Netlify (org-familiar): what the other lecture repos use today, via quantecon/actions/preview-netlify@v0.6.0. Needs a site + NETLIFY_AUTH_TOKEN / NETLIFY_SITE_ID secrets.

Once decided, the change to ci.yml is small — replace the upload-artifact step with the chosen preview action and add pull-requests: write to the job permissions, e.g.:

      - name: Deploy PR preview
        uses: quantecon/actions/preview-cloudflare@v0.6.0
        with:
          cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          project-name: lecture-dp
          build-dir: ${{ steps.build.outputs.build-path }}
          lectures-dir: lectures

Both actions post a PR comment with the preview URL and changed-lecture links, and skip fork PRs for secret safety.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions