Staging and PR previews
Two kinds of Amplify environments
Section titled “Two kinds of Amplify environments”| Kind | Git | Amplify URL shape | Lifetime |
|---|---|---|---|
| Staging Long-lived Git branch (and Amplify branch) used as a pre-production environment before promoting to main. |
Branch staging |
https://staging.<app-id>.amplifyapp.com |
Long-lived |
| Production | Branch main |
https://main.<app-id>.amplifyapp.com |
Long-lived |
| PR preview Temporary Amplify hosting URL created for a pull request so you can review the built site before merge. |
Open pull request | https://pr-<n>.<app-id>.amplifyapp.com |
Until PR closes / branch deleted |
Exact hostnames use your Amplify app id. This lab does not add custom domains.
How to use them
Section titled “How to use them”- Feature work lands on a short-lived branch
- Open a PR into
staging- CI must pass; Amplify builds a PR preview - Merge to
staging- validate on the staging Amplify URL - Open a PR from
stagingintomain- same CI gate - Merge to
main- production Amplify URL updates
Branch auto-delete
Section titled “Branch auto-delete”Enable branch auto-delete
Amplify setting that removes a preview branch and its URL when the Git branch is deleted. on the Amplify app so preview branches disappear when the Git branch is deleted. That cleans up preview URLs; it does not delete the Amplify app itself.