ci-cd-intro
ci-cd-intro copied to clipboard
Intro to CI/CD 💻 ☁️
Intro to CI/CD 💻 ☁️
TLDR; This repository is a sample project demonstrating a basic continuous integration (CI) / continuous deployment (CD) setup. This project is in READ ONLY mode.
:warning: Fork this repository in order to use it! If you're following along the videos and trying to run the workflows here, they will not work.
Course attachement
This repository is best consumed while or after following the course attachment 👇
Project structure
# You can generate this tree with:
# $ tree -a -I '.git|assets|.github|venv|node_modules|images|.DS_Store|*.tfvars|.terraform'
.
├── .gitignore
├── CODEOWNERS
├── LICENSE
├── README.md
├── infra
│ ├── README.md
│ └── instances
│ ├── production
│ │ ├── .terraform.lock.hcl
│ │ ├── main.tf
│ │ └── terraform.auto.tfvars.example
│ └── staging
│ ├── .terraform.lock.hcl
│ ├── create_staging_resource.sh
│ ├── extra_staging.tf.example
│ ├── main.tf
│ └── terraform.tfvars.auto.example
└── web
├── README.md
├── app.js
├── bin
│ └── www
├── package-lock.json
├── package.json
├── public
│ ├── javascripts
│ └── stylesheets
│ └── style.css
├── routes
│ ├── index.js
│ └── users.js
├── tests
│ ├── app.test.js
│ └── routes.test.js
└── views
├── error.jade
├── index.jade
└── layout.jade
12 directories, 26 files
infra/images: contains Packer template to build our AWS EC2 AMIinfra/instances: contains our Terraform templates to setup ourstagingandproductionEC2 instancesweb: contains our simple Express web application
Setup
Configure your GitHub repository to run the workflows
Click to expand
-
Navigate to the
Settingsin your repository then toEnvironments
-
Add a new environment and call it
staging(or anything else you like)
-
Enable required reviewers and add your secrets

-
Enable branch protection on the
mainbranch

Test your setup
- Create a new branch from the
mainbranch and make some changes to the app - Push the new branch to GitHub
- Watch the CI workflow being triggered
- Troubleshoot issues as they rise
LICENSE
Copyright (c) 2021 Bassem Dghaidi (@Link-)
