A sample repository showing how GitHub Actions can be used to provide per-PR staging environments.
- Create a fork of this repository.
- Change a file in your fork.
src/pages/index.js
is a great one to test out. - Submit a pull request back to this repository.
- After your pull request is created, write a comment on the pull request with the first line being
/deploy
- Wait a minute or so. GitHub should create a staging environment for your pull request and publish it automagically!
- When you're done playing, write a comment on the pull request with the first line being
/teardown
- Create a fork of this repository.
- Sign up for Surge (
npm install --global surge; surge login
) - Enable action workflows under the Actions tab of your fork.
- You'll need to add three secrets to your repository:
DISPATCH_TOKEN
- a personal access token withpublic_repo
scope.SURGE_LOGIN
- the email address you used to sign up with Surge.SURGE_TOKEN
- the output ofsurge token