Welcome to the GitHub CI/CD Template repository! This project provides a robust and flexible CI/CD pipeline setup using GitHub Actions, tailored for project using Python for backend, node frontend, docker-compose or Dockerfile. Leverage this template to automate your development workflow, from testing and building to deployment and monitoring.
Before you begin, ensure you have met the following requirements:
Clone the Repository
git clone https://github.com/JuanVilla424/github-cicd-template.git
Navigate to the Project Directory
cd github-cicd-template
Mandatory: Setting Up a Python Virtual Environment
Setting up a Python virtual environment ensures that dependencies are managed effectively and do not interfere with other projects.
Create a Virtual Environment
python -m venv venv
Activate the Virtual Environment
On Unix or MacOS:
source venv/bin/activate
On Windows:
.\venv\Scripts\activate
powershell.exe -ExecutionPolicy Bypass -File .\venv\Scripts\Activate.ps1
Upgrade pip
pip install --upgrade pip
Install Dependencies
pip install -r requirements.txt
pip install poetry
poetry lock
poetry install
When youβre done, deactivate the environment:
deactivate
Docker Extra Steps: Install Scoop and then install hadolint using scoop, refer to Extra Steps
Install and check pre-commit hooks: MD files changes countermeasures, python format, python lint, yaml format, yaml lint, version control hook, changelog auto-generation
pre-commit install
pre-commit install -t pre-commit
pre-commit install -t pre-push
pre-commit autoupdate
pre-commit run --all-files
Docker:
brew install hadolint
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
scoop install halint
To utilize the CI/CD pipeline, follow these steps:
Configure GitHub Actions
Set Up Secrets
Triggering the Pipeline
Monitoring Pipeline Status
Contributions are welcome! To contribute to this repository, please follow these steps:
Fork the Repository
Create a Feature Branch
git checkout -b feature/your-feature-name
Commit Your Changes
git commit -m "feat(<scope>): your feature commit message - lower case"
Push to the Branch
git push origin feature/your-feature-name
Open a Pull Request into dev
branch
Please ensure your contributions adhere to the Code of Conduct and Contribution Guidelines.
Create a New Workflow File
touch .github/workflows/new-workflow.yml
Define the Workflow
Customize the workflow according to your needs, using existing workflows as references.
Commit and Push
git add .github/workflows/new-workflow.yml
git commit -m "chore(core): added new workflow - lower case"
git push origin feature/your-feature-name
For any inquiries or support, please open an issue or contact r6ty5r296it6tl4eg5m.constant214@passinbox.com.
2024 - This project is licensed under the GNU General Public License v3.0. You are free to use, modify, and distribute this software under the terms of the GPL-3.0 license. For more details, please refer to the LICENSE file included in this repository.