A collection of reusable workflows and composite actions to avoid duplicating the content of workflows in GitHub actions.
Important
Start with these two articles in the GitHub Actions documentation: Reusing workflows and Avoiding duplication
Tip
Composite actions available in this repository.
- Abort if there is uncommitted code
- Add Helm repositories
- Disable man-db triggers
- Ensures a branch exists and aborts otherwise
- Parses the package version
- Send Rocket.Chat message
- Setup Java
- Setup Maven Build Variables
- Setup Maven Project Version
- Setup Nexus NPM Repository Access
- Setup Node.JS and NPM dependencies
- Validate Version
Tip
Reusable workflows available in this repository.
- Archetype Update
- Changelog Update
- Deploy DEV
- Docker Images Move
- Git Patch Branch Create
- Git Tag Create
- Jira Release
- NPM Lint
- Nexus Artifacts Move
- Nexus Tag Associate
- Nexus Tag Create
- Nexus Tag Search
- Setup Maven Build Variables
- Tag Nexus Artifacts
- Version Bump
| Reusable workflows | Composite actions |
|---|---|
| A YAML file, very similar to any standard workflow file | An action containing a bundle of workflow steps |
Each reusable workflow is a single file in the .github/workflows directory of a repository |
Each composite action is a separate repository, or a directory, containing an action.yml file and, optionally, other files |
| Called by referencing a specific YAML file | Called by referencing a repository or directory in which the action is defined |
| Called directly within a job, not from a step | Run as a step within a job |
| Can contain multiple jobs | Does not contain jobs |
| Each step is logged in real-time | Logged as one step even if it contains multiple steps |
| Can connect a maximum of four levels of workflows | Can be nested to have up to 10 composite actions in one workflow |
| Can use secrets | Cannot use secrets |
Some workflows can be run locally using act.
Examples:
act -W '.github/workflows/test-validate-version.yml' --input version=9.5.0-202504281107-91-fc989f5 --container-architecture linux/amd64
act -j build -W '.github/workflows/test-maven.yml' --secret NEXUS3_PW=test --var NEXUS3_USER=test --container-architecture linux/amd64