This repository contains reusable GitHub Actions workflows for building, testing, and deploying applications. These workflows are designed to be called from other repositories using the workflow_call trigger.
Purpose: Builds and pushes a Docker image to Google Artifact Registry.
Type: Reusable workflow (called via workflow_call)
Inputs:
app-name(required, string): Name of the application being builtdocker-context(required, string): Path to the Docker build contextversion(required, string): Version tag for the Docker imagebuild-args(optional, string): Additional Docker build arguments
Secrets Required:
GCLOUD_KEY_FILE: Google Cloud credentials JSON
Outputs:
version: Version of the built Docker imagetag: Full tag of the Docker image in Google Artifact Registry (format:us-west2-docker.pkg.dev/dezzles-apps/dezzles-apps-docker/{app-name}:{version})
Key Steps:
- Checkout repository
- Authenticate with Google Cloud
- Configure Docker for Google Artifact Registry
- Build and push Docker image using
docker/build-push-action@v4 - Send event notifications on success/failure
Purpose: Builds a Java application using Gradle, then packages and pushes it as a Docker image.
Type: Reusable workflow (called via workflow_call)
Inputs:
app-name(required, string): Name of the Java applicationdocker-context(required, string): Path to the Docker build contextversion(required, string): Version tag for the Docker imagebuild-args(optional, string): Additional Docker build arguments
Secrets Required:
GCLOUD_KEY_FILE: Google Cloud credentials JSON
Outputs:
version: Version of the built Docker imagetag: Full tag of the Docker image in Google Artifact Registry
Key Steps:
- Checkout repository
- Setup Java 21 with Gradle caching
- Build Java application via
./gradlew buildin the specified context - Authenticate with Google Cloud
- Configure Docker for Google Artifact Registry
- Build and push Docker image
- Send event notifications on success/failure
Purpose: Deploys to Google Cloud Run using declarative spec metadata files. The specs being deployed will typically be using metadata spec files based on a project.yml and generated by the create-specs.yml workflow.
Type: Reusable workflow (called via workflow_call)
Inputs:
app-name(required, string): Name of the applicationenvironment(required, string): Target environment (e.g., dev, staging, prod)
Secrets Required:
GCLOUD_KEY_FILE: Google Cloud credentials JSON
Key Steps:
- Checkout repository
- Download
cloud-run-specsartifact (generated bycreate-specs.yml) - Authenticate with Google Cloud
- Deploy to Cloud Run using metadata file:
{app-name}-{environment}.yml- Region:
us-west1
- Region:
- Send event notifications on success/failure
Purpose: Extracts and outputs application configuration including name, version, and build type information.
Type: Reusable workflow (called via workflow_call)
Outputs:
app-name: Name of the applicationversion: Version being builtspec-file: Path to the generated spec fileis-release: Boolean flag indicating if this is a release build
Key Steps:
- Checkout repository
- Run
dezzles-apps/actions-config@mainto extract configuration - Output configuration variables for use in downstream workflows
Note: This is a utility workflow typically called early in build pipelines to determine build parameters.
Purpose: Generates Google Cloud Run deployment specification files from a project configuration file.
Type: Reusable workflow (called via workflow_call)
Inputs:
version(required, string): Version to include in specsspec(optional, string): Path to the spec template file (default:./project.yml)
Key Steps:
- Checkout repository
- Run
dezzles-apps/spec-creater@mainto generate specs- Uses the provided spec template
- Substitutes the version
- Upload generated specs to artifacts with name
cloud-run-specs
Output Artifacts:
cloud-run-specs: Contains generated.ymlspec files for Cloud Run deployment
Note: Specs are uploaded as artifacts for use by cloud-run-spec-deploy.yml.
Purpose: Runs functional tests using Gradle and Karate testing framework, with test results publishing.
Type: Reusable workflow (called via workflow_call)
Inputs:
env(required, string): Environment to test against (used as Karate environment profile)
Secrets Required:
GCLOUD_KEY_FILE: Google Cloud credentials JSON (for event notifications)
Key Steps:
- Checkout repository
- Setup Java 21 with Gradle caching
- Run functional tests using Gradle:
./gradlew functional-tests:test -Dkarate.env={env} - Publish test results to GitHub using
test-summary/action@v2- Reads JUnit XML from
functional-tests/build/test-results/**/*.xml
- Reads JUnit XML from
- Send event notifications on success/failure
Note: Tests run against the specified environment using Karate's environment variable system.
Purpose: Publishes built artifacts and version information to Portfolio
Type: Reusable workflow (called via workflow_call)
Inputs:
version(required, string): Version to publish
Secrets Required:
GCLOUD_KEY_FILE: Google Cloud credentials JSON
Key Steps:
- Checkout repository
- Send event notification that publishing is starting
- Run
dezzles-apps/action-event/actions/publish@mainto publish- Passes the version to publish
- Send event notifications on success/failure
Note: This workflow is typically called after successful deployment to document the released version.
Purpose: Performs code quality analysis using SonarQube with Gradle and JaCoCo code coverage.
Type: Reusable workflow (called via workflow_call)
Inputs:
app-name(required, string): Name of the application/module to analyze
Secrets Required:
SONAR_TOKEN: SonarQube authentication token
Key Steps:
- Checkout repository with full history (fetch-depth: 0 for better analysis)
- Setup Java 21
- Cache SonarQube and Gradle packages for faster execution
- Run SonarQube analysis:
./gradlew {app-name}:build jacocoTestReport sonar- Compiles the application module
- Generates JaCoCo code coverage report
- Sends results to SonarQube
Note: Requires proper SonarQube configuration in build.gradle or gradle.properties.
Typical workflow composition for building and deploying an application:
- create-config.yml → Extract app name, version, and configuration
- build-docker.yml or build-java-docker.yml → Build and push Docker image
- create-specs.yml → Generate Cloud Run deployment specs
- cloud-run-deploy.yml or cloud-run-spec-deploy.yml → Deploy to target environment
- functional-tests.yml → Validate deployment with tests
- publish-to-portfolio.yml → Publish release information
- sonar-scan.yml → Run code quality analysis
Below is a real-world example of how these reusable workflows are composed together for a multi-service application (shiny-hunt):
name: Build And Deploy
on:
push:
jobs:
notify-start:
runs-on: ubuntu-latest
steps:
- uses: dezzles-apps/action-event/actions/event@main
id: event
with:
credentialsJson: ${{ secrets.GCLOUD_KEY_FILE }}
message: "Starting build process for commit: ${{ github.event.head_commit.url }}"
configuration:
uses: dezzles-apps/actions/.github/workflows/create-config.yml@main
needs: [ notify-start ]
build-ui:
uses: dezzles-apps/actions/.github/workflows/build-docker.yml@main
needs: [ configuration ]
with:
app-name: shiny-hunt-ui
docker-context: ./shiny-stats
version: '${{ needs.configuration.outputs.version }}'
secrets: inherit
build-api:
uses: dezzles-apps/actions/.github/workflows/build-java-docker.yml@main
needs: [ configuration ]
with:
app-name: shiny-stats-java-server
docker-context: ./shinyhunt
version: '${{ needs.configuration.outputs.version }}'
secrets: inherit
generate-specs:
uses: dezzles-apps/actions/.github/workflows/create-specs.yml@main
needs: [ configuration ]
with:
version: '${{ needs.configuration.outputs.version }}'
deploy-non:
uses: dezzles-apps/actions/.github/workflows/cloud-run-spec-deploy.yml@main
needs: [ generate-specs, build-ui, build-api ]
with:
environment: non
app-name: shiny-hunt
secrets: inherit
functional-tests:
uses: dezzles-apps/actions/.github/workflows/functional-tests.yml@main
needs: [ deploy-non ]
with:
env: non
secrets: inherit
deploy-prod:
uses: dezzles-apps/actions/.github/workflows/cloud-run-spec-deploy.yml@main
needs: [ functional-tests ]
with:
environment: prod
app-name: shiny-hunt
secrets: inherit
publish:
uses: dezzles-apps/actions/.github/workflows/publish-to-portfolio.yml@main
needs: [ deploy-prod, configuration ]
with:
version: '${{ needs.configuration.outputs.version }}'
secrets: inheritThis example demonstrates:
- notify-start: Send initial event notification
- configuration: Extract version and app metadata (runs after notify-start)
- build-ui and build-api: Build UI and API services in parallel using the extracted version
- generate-specs: Generate Cloud Run deployment specs with the version
- deploy-non: Deploy both services to the non-prod environment (waits for both builds and specs)
- functional-tests: Run end-to-end tests against non-prod environment
- deploy-prod: Deploy to production only after tests pass
- publish: Publish the release to portfolio
This pipeline ensures:
- Parallel building: UI and API build simultaneously for faster execution
- Quality gates: Functional tests must pass before production deployment
- Version consistency: All components use the same version extracted from configuration
- Audit trail: Event notifications track progress at each stage
- Secrets management: Uses
secrets: inheritto pass credentials through the workflow chain
Most workflows require Google Cloud authentication via the GCLOUD_KEY_FILE secret. This should be set at the repository or organization level and contain a Google Cloud service account JSON key with appropriate permissions for:
- Docker registry access (Google Artifact Registry)
- Cloud Run deployments
- Event/notification system access
Workflows use a custom dezzles-apps/action-event action to send event notifications for build start, success, and failure. This integrates with the build engine and sends notifications to Discord.
- All workflows are designed to be idempotent and safe to retry
- Workflows use event notifications for audit trails and status updates
- Java-based builds use Gradle with caching for faster execution
- Cloud Run deployments target the
us-west1region - Docker images are pushed to Google Artifact Registry at
us-west2-docker.pkg.dev/dezzles-apps/dezzles-apps-docker/