Centralized, reusable GitHub Actions workflows for OpenGood CI/CD pipelines. This repository provides standardized workflow definitions for building, testing, releasing, and deploying projects across multiple languages and platforms.
This repository serves as the single source of truth for CI/CD workflows used across the OpenGood organization. It provides:
- Reusable Workflows: Centralized workflow definitions in
.github/workflows/that can be called from any repository - Copy-Paste Templates: Ready-to-use workflow files in
workflows/organized by platform and project type - Standardized Processes: Consistent build, test, release, and deployment patterns across all projects
- Reduced Duplication: Changes to workflows propagate to all consuming repositories automatically
These are the core workflow definitions that perform the actual CI/CD work. They use the workflow_call trigger and accept inputs and secrets as parameters.
Key workflows:
Build workflows:
bash-bats-build.yml- Builds Bash projects with BATS testing frameworkgradle-lib-build.yml- Builds Gradle libraries with Java setup, ktlint validation, and optional code coveragegradle-lib-postgres-build.yml- Builds Gradle libraries with PostgreSQL integrationgradle-app-build.yml- Builds Gradle applicationsgradle-app-postgres-build.yml- Builds Gradle applications with PostgreSQL integrationgradle-cli-build.yml- Builds Gradle CLI applicationsgradle-plugin-build.yml- Builds Gradle pluginspython-package-build.yml- Builds Python packages with pytest and ruff linting
Release workflows:
gradle-maven-central-release.yml- Releases Gradle artifacts to Maven Central with GPG signinggradle-plugin-release.yml- Publishes Gradle plugins to Gradle Plugin Portalgradle-github-release.yml- Creates GitHub releases for Gradle projectspython-release-build.yml- Builds Python package distributions for releasepython-release.yml- Creates GitHub releases for Python projects with version bumping
Deployment workflows:
gradle-azure-app-service-deploy.yml- Deploys applications to Azure App Service
Code quality workflows:
java-kotlin-code-coverage.yml- Generates and uploads code coverage reports for Java/Kotlinjava-kotlin-postgres-code-coverage.yml- Generates code coverage for Java/Kotlin with PostgreSQLpython-code-coverage.yml- Generates and uploads code coverage reports for Pythonjava-kotlin-codeql-analyze.yml- CodeQL security analysis for Java/Kotlinpython-codeql-analyze.yml- CodeQL security analysis for Python
Utility workflows:
workflow-cancel.yml- Cancels in-progress workflowsworkflow-update-license-copyright.yml- Updates license copyright headersworkflow-update-actions.yml- Updates GitHub Actions versions in workflowsworkflow-clear-packages.yml- Clears old GitHub packagesgradle-dependencies-submit.yml- Submits Gradle dependency graph to GitHublocal-update-actions.yml- Local workflow wrapper for updating GitHub Actions versionslocal-update-license-copyright.yml- Local workflow wrapper for updating license copyright
Thin wrapper workflows organized by language/platform and project type. These serve as starting points for consuming repositories and reference the reusable workflows.
Supported platforms and project types:
| Platform | Project Types |
|---|---|
| Bash | bats - Projects using BATS testing framework |
| Gradle | lib - Java/Kotlin librarieslib-postgres - Libraries with PostgreSQLapp-postgres - Applications with PostgreSQLapp-web-mvc - Web MVC applicationscli - Command-line applicationsplugin - Gradle plugins |
| Python | package - Python packages |
-
Copy the appropriate workflow templates from
workflows/{platform}/{project-type}/to your repository's.github/workflows/directory -
Configure required secrets and variables in your repository settings
-
The workflows will reference the centralized implementations using:
jobs:
build:
uses: opengood-aio/central-workflows/.github/workflows/gradle-lib-build.yml@main
with:
run-code-coverage: true
run-gradle-validation: true
secrets:
codecov-token: ${{ secrets.CODECOV_TOKEN }}-
Copy workflows from
workflows/gradle/lib/:build.yml- Build and test on every pushrelease.yml- Release to Maven Central on PR merge with 'release' labelcoverage.yml- Code coverage reportingcodeql.yml- Security analysiscancel.yml- Cancel in-progress workflows
-
Configure repository secrets:
CODECOV_TOKEN- Codecov integrationGPG_SIGNING_KEY_ID- GPG key ID for Maven CentralGPG_SIGNING_PASSWORD- GPG key passwordGPG_SIGNING_PRIVATE_KEY- GPG private keyMAVEN_CENTRAL_REPO_USERNAME- Maven Central usernameMAVEN_CENTRAL_REPO_PASSWORD- Maven Central passwordWORKFLOW_TOKEN- GitHub token with workflow permissions
-
Configure repository variables:
GIT_EMAIL- Git user email for automated commitsGIT_USER- Git username for automated commits
-
Copy workflows from
workflows/python/package/:build.yml- Build and test with pytest and ruff lintingrelease.yml- Build package, publish to PyPI, and create GitHub releasecoverage.yml- Code coverage reportingcodeql.yml- Security analysiscancel.yml- Cancel in-progress workflowsupdate-actions.yml- Auto-update GitHub Actions versionsupdate-license-copyright.yml- Update copyright headers
-
Configure repository secrets:
CODECOV_TOKEN- Codecov integrationWORKFLOW_TOKEN- GitHub token with workflow permissions
-
Configure repository variables:
GIT_EMAIL- Git user email for automated commitsGIT_USER- Git username for automated commits
-
Set up PyPI trusted publishing:
- Configure PyPI trusted publisher for your repository
- No API token needed - uses OpenID Connect (OIDC)
The following workflow templates are available in the workflows/ directory for each project type:
-
build.yml- Triggered on all branches exceptmain, runs tests and validation- Gradle: Runs
./gradlew clean buildwith ktlint code style checks - Python: Runs
pytestwith ruff linting and formatting checks - Bash: Runs BATS test suite
- Gradle: Runs
-
release.yml- Triggered when a PR is merged tomainwith thereleaselabel- Gradle libraries: Publishes to Maven Central with GPG signing
- Gradle plugins: Publishes to Gradle Plugin Portal
- Python packages: Builds and publishes to PyPI with trusted publishing
- Creates a GitHub release with version tag
-
coverage.yml- Runs code coverage analysis and uploads to Codecov- Gradle: Uses JaCoCo for Java/Kotlin coverage
- Python: Uses pytest-cov for Python coverage
- PostgreSQL projects: Includes database integration test coverage
-
codeql.yml- Runs GitHub CodeQL security analysis on schedule and push -
cancel.yml- Cancels in-progress workflows when new commits are pushed -
update-license-copyright.yml- Updates license copyright headers on schedule -
dependencies-submit.yml- Submits dependency graph to GitHub (Gradle projects only)
The following templates are available for application projects (app-postgres, app-web-mvc):
deploy-dev.yml- Deploys to dev environment when PR merged tomainwithdeploy devlabeldeploy-prod.yml- Deploys to prod environment when PR merged tomainwithdeploy prodlabelclear-packages.yml- Clears old GitHub packages on schedule
| Tool | Default Version | Configurable |
|---|---|---|
| Java | 21 (Temurin) | Yes, via inputs |
| Python | 3.13 | Yes, via inputs |
| ktlint | 1.2.1 | No |
| ruff | Latest | No |
Changes to these files affect all consuming repositories:
- Test changes thoroughly before merging
- Maintain backward compatibility with existing inputs/secrets
- Document any breaking changes
- Consider versioning workflow calls using tags instead of
@main
- Create a new directory:
workflows/{platform}/{project-type}/ - Copy workflows from a similar project type as a starting point
- Update the
uses:references to the appropriate reusable workflows - Add required inputs and secrets for the workflow type
- Follow naming conventions:
{workflow-type}.yml
When contributing to this repository:
- Ensure workflows are tested in a sandbox repository before merging
- Update this README if adding new workflow types
- Follow existing patterns for consistency
- Document all required secrets and variables
This project is licensed under the MIT License - see the LICENSE file for details.