Define a Build - Test - Push workflow having three jobs:
branch: This job gets the name of the branch being pushed or dispatched to and sets an environment variable based on the branch name (production for master, sandbox for other branches).
test: This job runs e2e tests for the project using Go and the go test command.
build-ami: This job builds an Amazon Machine Image (AMI) for production (if the push is to the master branch) using Packer.
All jobs are configured to run on every push to the repository and also can be triggered manually from the GitHub Actions page using the workflow_dispatch event.
Environments
Sandbox
Production
Both environments have the same following secrets:
Define a
Build - Test - Push
workflow having three jobs:branch
: This job gets the name of the branch being pushed or dispatched to and sets an environment variable based on the branch name (production
formaster
,sandbox
for other branches).test
: This job runs e2e tests for the project using Go and thego test
command.build-ami
: This job builds an Amazon Machine Image (AMI) for production (if the push is to themaster
branch) using Packer.All jobs are configured to run on every push to the repository and also can be triggered manually from the GitHub Actions page using the
workflow_dispatch
event.Environments
Both environments have the same following secrets:
Link to Pull Request
Link to Pull Request