Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soulsbros/cicd-template
Shared template for GitHub Actions
https://github.com/soulsbros/cicd-template
automation cicd docker template
Last synced: 2 days ago
JSON representation
Shared template for GitHub Actions
- Host: GitHub
- URL: https://github.com/soulsbros/cicd-template
- Owner: soulsbros
- Created: 2024-09-09T21:15:44.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-26T23:21:02.000Z (9 days ago)
- Last Synced: 2025-01-27T00:22:39.799Z (9 days ago)
- Topics: automation, cicd, docker, template
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CICD-template
![Test workflow](https://github.com/steeven9/CICD-template/actions/workflows/test.yml/badge.svg)
Shared template for GitHub Actions
## Usage
For example, to build on all branches and tags, add this to `.github/workflows/your-workflow.yml`:
```yaml
name: your-workflowon:
push:
branches:
- "*"
tags:
- "*"jobs:
build-tags:
# Build and push the image with the tag name
uses: steeven9/CICD-template/.github/workflows/docker-build.yml@main
if: github.ref_type == 'tag'
with:
image-name: some-org/some-image:${{ github.ref_name }} # TODO adapt to your needs
push: true
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}build-branches:
# Build all branches but push only in main
uses: steeven9/CICD-template/.github/workflows/docker-build.yml@main
if: github.ref_type == 'branch'
with:
image-name: some-org/some-image:latest # TODO adapt to your needs
push: ${{ github.ref_name == 'main' }}
ping_webhook: ${{ github.ref_name == 'main' }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
```You can also override the Dockerfile location with the `dockerfile` input.
## Resources
### Actions used
### Documentation