Build the same way on GitHub Actions, GitLab CI, and CircleCI. All logic in scripts.
Template for portable CI/CD. No duplicate code. Scripts do the work.
Supports:
- Open-source contributors → GitHub Actions
- Internal/self-hosted infra → GitLab CI
- Legacy or enterprise pipelines → CircleCI
CI files orchestrate. Scripts run.
Each CI:
- Check out code
- Set up environment
- Run scripts
Run CI locally:
make ciOr:
./scripts/ci/setup.sh && ./scripts/ci/test.sh && ./scripts/ci/build.sh && ./scripts/ci/lint.shWorks locally = works on CI.
Test in container:
docker build -t ci-test .
docker run ci-testAuto-checks:
pip install pre-commit
pre-commit installManual: pre-commit run --all-files
Checks commit messages.
For customizable GitLab CI with inputs, see gitlab-inputs-example.yml.
🌳 Project Structure
├── 📁 scripts/ci/ # Build scripts
│ ├── 🔧 setup.sh # Setup
│ ├── 🧪 test.sh # Tests
│ ├── 🏗️ build.sh # Build
│ └── 🔍 lint.sh # Lint
├── 📋 Makefile # Local commands
├── 🚀 .github/workflows/ # GitHub Actions
├── 🔄 .gitlab-ci.yml # GitLab CI
├── 🔄 .circleci/ # CircleCI
└── 🔄 gitlab-inputs-example.yml # GitLab inputs example
Fork this. Add features. Test locally first.