- Setup:
curl -s https://raw.githubusercontent.com/AlekOmOm/cicd-templates/main/setup.sh | bash
- View templates:
gh list-cicd
- Apply template:
cd your-project && gh init-cicd deploy/node
- Configure: Edit
config/.env.config
- Deploy: Push to GitHub
cicd-templates/
├── templates/
│ ├── deploy/ # deployment setups (github actions, docker, env configs)
│ ├── integrate/ # ci workflows (testing, linting, security scans)
│ ├── monitor/ # logging, alerting, observability
│ ├── infrastructure/ # terraform, kubernetes, provisioning
│ ├── security/ # security hardening, access control, scanning
├── shared/ # reusable scripts, configs, common workflows
├── setup.sh # init for usage
├── README.md # for usage
├── CONTRIBUTING.md # for the devs
├── docs/ # detailed docs
# note: only deploy/node implemented so far
- Deployment
deploy/node
: Node.js Expressdeploy/react
: Reactdeploy/python
: Python Flask- 'deploy/rust_actix-web': Rust Actix-Web
# 1. One-time initialization (sets up gh CLI aliases)
curl -s https://raw.githubusercontent.com/AlekOmOm/cicd-templates/main/setup.sh | bash
# 2. List available templates
gh list-cicd
# 3. Initialize a template in your project (fetches and sets up)
cd /path/to/your/project
gh init-cicd deploy/node
# 4. Set config
vim ./config/.env.config # populate with your settings
# 5. Commit and push to trigger the CI/CD pipeline
git add .
git commit -m "Add CI/CD configuration"
git push
You have two options to set up the GitHub CLI aliases:
Option A: Using setup.sh (recommended)
curl -s https://raw.githubusercontent.com/AlekOmOm/cicd-templates/main/setup.sh | bash
Option B: Manual setup
# Clone the template repo temporarily
git clone https://github.com/AlekOmOm/cicd-templates.git /tmp/cicd-templates
# Run the initialization script
bash /tmp/cicd-templates/templates/deploy/node/init.script.sh
# Clean up
rm -rf /tmp/cicd-templates
This will set up two GitHub CLI aliases:
gh list-cicd
: Lists all available templatesgh fetch-cicd
: Fetches a specific template
gh list-cicd
📌 What happens?
- Clones
cicd-templates
into a temporary directory - Lists available templates by category
- Removes the temporary clone
# Navigate to your project root
cd /path/to/your/project
# Fetch the Node.js deployment template
gh fetch-cicd deploy/node
📌 What happens?
- Clones
cicd-templates
into a temporary directory - Copies the specified template files into your current project
- Removes the temporary clone
-
Edit the
.env.config
file with your project settings# Example: Set your app name and other configuration vim .env.config
-
Apply the configuration to generate deployment files
# Install dotenv dependency if not already installed npm install --save-dev dotenv # Run the configuration script node scripts/apply-config.js
-
Review the generated files:
.github/workflows/deploy.yml
Dockerfile
docker-compose.yml
-
Set up GitHub repository secrets (using the GitHub web interface or CLI):
SERVER_HOST
: Your deployment server hostname/IPSERVER_USER
: SSH username for deploymentSSH_PRIVATE_KEY
: Your SSH private keySSH_PORT
: SSH port (usually 22)
-
Commit and push to trigger the CI/CD pipeline
git add . git commit -m "Add CI/CD configuration" git push
✅ Minimal overhead (no need for complex scripts)
✅ Portable & works on any machine with gh
installed
✅ Easy to maintain since everything is inside a single repo
✅ Allows versioning & reuse with shared scripts