Skip to content

Prove the flow

Create an issue, then from staging:

Terminal window
git checkout staging
git pull
git checkout -b feature/hello-preview
# make a small visible change on the home page
git add .
git commit -m "feat: visible preview change for amplify lab
Bump homepage copy so the PR preview is easy to recognize."
git push -u origin HEAD

Open the PR against staging (not main). Link the issue with Closes #N.

Example: jajera/amplify-astro-cicd#4

GitHub PR description — summary, Closes issue, test plan for Amplify preview lab

Wait until GitHub checks are green (CI build, markdown-lint, commitmsg-conform) and Amplify Web Preview has posted a URL.

GitHub PR — all checks passed including Amplify Web Preview and CI build

Amplify posts a preview URL on the PR (shape https://pr-<n>.<app-id>.amplifyapp.com). Open it and confirm the homepage marker is visible.

Amplify bot comment on the PR with the PR preview URL
Browser open on the Amplify PR preview URL with the hello-preview homepage marker

Squash-merge into staging (not main). With GitHub auto-delete head branches on, the feature branch disappears after merge.

GitHub PR #4 merged into staging from feature/hello-preview
GitHub — pull request successfully merged and closed

Open https://staging.<app-id>.amplifyapp.com and wait for Amplify to finish deploying staging. Confirm the homepage marker is live.

Browser on staging amplifyapp.com URL showing the hello-preview homepage marker after merge

After the feature branch is gone, Amplify disconnects the PR preview. Opening the old https://pr-<n>.<app-id>.amplifyapp.com URL (or the preview branch in the Console) should fail — for example Branch pr-4 not found.

Amplify — Branch pr-4 not found after preview auto-disconnection

1. Open a pull request from staging into main

Section titled “1. Open a pull request from staging into main”

Promote only after staging looks right. Open the PR into main from staging (not from the feature branch).

Example: jajera/amplify-astro-cicd#5

GitHub PR #5 description — promote staging homepage marker to main, test plan

Wait until required GitHub checks are green. Previews stay off for main, so you should not expect an Amplify Web Preview on this PR.

GitHub PR #5 — all checks passed, no conflicts, Squash and merge ready

Squash-merge into main.

GitHub PR #5 Merged — 1 commit into main from staging

In Amplify Hosting, wait until main finishes deploying (status moves from Deploying to successful).

Amplify Hosting — main production branch deploying after staging promote

Then open https://main.<app-id>.amplifyapp.com and confirm it matches staging (homepage marker visible).

Browser on main amplifyapp.com URL showing the hello-preview homepage marker after promote
  • PR preview URL served the feature change
  • Staging URL updated after merge to staging
  • Main URL updated after merge to main
  • Preview host gone (automatic or Console delete)
  • No custom domain required

Next: Teardown.