Prove the flow
Feature branch → staging
Section titled “Feature branch → staging”Create an issue, then from staging:
git checkout staginggit pullgit checkout -b feature/hello-preview# make a small visible change on the home pagegit 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 HEAD1. Open a pull request into staging
Section titled “1. Open a pull request into staging”Open the PR against staging (not main). Link the issue with Closes #N.
Example: jajera/amplify-astro-cicd#4
2. Wait for GitHub CI to pass
Section titled “2. Wait for GitHub CI to pass”Wait until GitHub checks are green (CI build, markdown-lint, commitmsg-conform) and Amplify Web Preview has posted a URL.
3. Confirm the Amplify PR preview
Section titled “3. Confirm the Amplify PR preview”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.
4. Merge the PR
Section titled “4. Merge the PR”Squash-merge into staging (not main). With GitHub auto-delete head branches on, the feature branch disappears after merge.
5. Confirm staging shows the change
Section titled “5. Confirm staging shows the change”Open https://staging.<app-id>.amplifyapp.com and wait for Amplify to finish deploying staging. Confirm the homepage marker is live.
6. Confirm the preview host is gone
Section titled “6. Confirm the preview host is gone”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.
Staging → main
Section titled “Staging → main”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
2. Wait for CI
Section titled “2. Wait for CI”Wait until required GitHub checks are green. Previews stay off for main, so you should not expect an Amplify Web Preview on this PR.
3. Merge
Section titled “3. Merge”Squash-merge into main.
4. Confirm main shows the change
Section titled “4. Confirm main shows the change”In Amplify Hosting, wait until main finishes deploying (status moves from Deploying to successful).
Then open https://main.<app-id>.amplifyapp.com and confirm it matches staging (homepage marker visible).
Success criteria
Section titled “Success criteria”- 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.