This project uses GitHub Actions to automatically build and push container images to Quay.io. This guide explains how to set up the required secrets and understand the workflows.
You need to configure two secrets in your GitHub repository for automatic container image pushing to Quay.io.
QUAY_USERNAMEsshaaf)QUAY_PASSWORDRecommended: Use Quay.io Robot Token
For better security, use a robot account instead of your personal credentials:
github_actions)QUAY_USERNAME (e.g., sshaaf+github_actions)QUAY_PASSWORDbuild-artifacts.yml)Triggers:
main branchmain branchJobs:
build-jarbuild-native-linuxbuild-native-macosbuild-native-windowsbuild-and-push-container Newmain branch (not on PRs)<git-commit-sha> (e.g., 49ff54e) - primary taglatest - always updatedWhy only on main?
release.yml)Triggers:
Version Management:
pom.xmlJobs:
All build jobs from above, plus:
build-and-push-container (Release version)<git-commit-sha> (e.g., 49ff54e) - primary tag<version> (e.g., 0.3.0) - semantic versionlatest - always updatedrelease| Event | Git SHA Tag | Version Tag | Latest Tag |
|---|---|---|---|
| Push to main | 49ff54e |
latest |
|
| Release | 49ff54e |
0.3.0 |
latest |
49ff54epom.xml0.3.0latest# Developer pushes to main
git push origin main
# GitHub Actions:
# 1. Builds JAR, native binaries (all platforms)
# 2. Builds and pushes container image to Quay.io
#
# Result:
# - quay.io/sshaaf/keycloak-mcp-server:49ff54e
# - quay.io/sshaaf/keycloak-mcp-server:latest
# Developer creates PR
git push origin feature-branch
# GitHub Actions:
# 1. Builds JAR, native binaries (all platforms)
# 2. Does NOT push container image
#
# Result:
# - Artifacts built and tested
# - No container images pushed (saves resources)
# Maintainer triggers release workflow manually
# GitHub Actions:
# 1. Builds JAR, native binaries (all platforms)
# 2. Builds and pushes container image with version tag
# 3. Creates GitHub release
#
# Result:
# - quay.io/sshaaf/keycloak-mcp-server:49ff54e
# - quay.io/sshaaf/keycloak-mcp-server:0.3.0
# - quay.io/sshaaf/keycloak-mcp-server:latest
# - GitHub release with all artifacts
After a push to main or a release, you can verify the images:
Go to the workflow run and check the Image Details section in the summary.
# Pull by commit SHA (recommended)
docker pull quay.io/sshaaf/keycloak-mcp-server:49ff54e
# Pull latest
docker pull quay.io/sshaaf/keycloak-mcp-server:latest
# Pull by version (releases only)
docker pull quay.io/sshaaf/keycloak-mcp-server:0.3.0
Visit: https://quay.io/repository/sshaaf/keycloak-mcp-server?tab=tags
Error:
Error: unauthorized: access to the requested resource is not authorized
Solution:
QUAY_USERNAME and QUAY_PASSWORD secrets are set correctlyError:
Error: repository not found
Solution:
quay.io/sshaaf/keycloak-mcp-serverError:
Tag contains @git.commit.id.abbrev@
Solution:
fetch-depth: 0 is set in checkout step (already configured)Check:
main branch (not a PR)if: github.event_name == 'push' && github.ref == 'refs/heads/main'build-and-push-container jobYou can test container building locally without pushing:
# Build without pushing
mvn clean package -Dquarkus.container-image.build=true
# Build and push manually (requires local Docker)
mvn clean package \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=true \
-Dquarkus.container-image.username=$QUAY_USERNAME \
-Dquarkus.container-image.password=$QUAY_PASSWORD
Old images accumulate over time. Consider:
latest forever0.3.0) forever# Delete specific tag (via Quay.io UI or API) ```
Setup: Configure QUAY_USERNAME and QUAY_PASSWORD secrets
Push to main: Automatic container build and push with git SHA
Pull requests: Build only, no push (saves resources)
Releases: Build and push with git SHA + version tag
Tags: Git commit SHA (primary) + latest (always) + version (releases)
Security: Use robot accounts with minimal permissions
Your GitHub Actions are now configured to automatically push container images to Quay.io!
For any issues, check the GitHub Actions logs or Quay.io repository.