PR Review Lab · Deploy Previews and Production From CI

30:00left of 30:00

Deploy Previews and Production From CI

Deploys are a manual script someone runs from their laptop. This adds two workflows: one that builds every pull request and posts a preview link, including PRs from forks so outside contributors get previews too, and one that tests and deploys main to production on every merge. AWS keys and the preview token are in repository secrets.

A.github/workflows/preview.yml1 of 3

Files Changed

.github/workflows/

scripts/

.github/workflows/preview.yml

YAML · Click a line number to comment · Tap a line to comment
@@ -0,0 +1,18 @@
Added: name: Preview
Added:
Added: on:
Added: pull_request_target:
Added: types: [opened, synchronize]
Added:
Added: jobs:
Added: preview:
Added: runs-on: ubuntu-latest
Added: steps:
Added: - uses: actions/checkout@v4
Added: with:
Added: ref: ${{ github.event.pull_request.head.sha }}
Added: - run: npm ci && npm run build
Added: - uses: quickship/preview-deploy-action@main
Added: with:
Added: token: ${{ secrets.PREVIEW_DEPLOY_TOKEN }}
Added: comment-on-pr: true