Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robandpdx/cd-demo
https://github.com/robandpdx/cd-demo
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/robandpdx/cd-demo
- Owner: robandpdx
- License: mit
- Created: 2023-03-17T17:59:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-04T04:15:18.000Z (4 months ago)
- Last Synced: 2024-11-04T11:11:55.356Z (2 months ago)
- Language: HCL
- Size: 62.5 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cd-demo
This repo demonstrates how to implement GitHub actions workflows to build and deploy PRs, as well as a blue green deployments to staging and production environments.
This repo uses a cloudformation template to deploy a stack to AWS. The stack contains an auto-scaling-group of ec2 instances, a load balancer, and other related resources.
There are several workflows in this repo:
- PR - build and deploy
- PR - delete stack
- Blue Green Deploy Pipeline## PR - build and deploy
This workflow is triggered when a PR is created or updated. The workflow does the following:
- Build and run unit tests
- Build AMI using Packer
- Deploy a test stack in AWS## PR - delete stack
This workflow is triggered when a PR is closed. The workflow deletes the test stack created by `PR - build and deploy`.## Blue Green Deploy Pipeline
This workflow is triggered on push to main. The workflow can also be triggered manually. The workflow does the following:
- Build and run unit tests (skipped if AMI is provided)
- Build AMI using Packer (skipped if AMI is provided)
- Deploy stack to staging and production environments in AWS## Credentials
This repo relies on the following repo secrets for authentication to AWS:
```
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
```## Environments
The `PR - build and deploy` workflows deploys to an [environment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment) named `cd-test`.The `Blue Green Deploy Pipeline` workflows deploys to an [environment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment) named `cd-staging` and `cd-production`.
Each environmnet needs to have the following [environment variables](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-variables) configured:
```
SUBNETS # list of subnets in AWS, comma separated
VPC # the VPC in AWS
```