keycloak-scim/.github/workflows/release-operator-container.yml
Bruno Oliveira da Silva 58956aa0b4 Publish container images on Docker Hub
Resolves #11986

Co-authored-by: andreaTP <andrea.peruffo1982@gmail.com>
2022-05-18 08:01:28 -03:00

65 lines
1.8 KiB
YAML

name: Release Keycloak Operator container
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
concurrency: keycloak-operator-container-release
env:
JDK_VERSION: 11
jobs:
publish:
if: github.repository == 'keycloak/keycloak'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ env.JDK_VERSION }}
cache: 'maven'
- name: Build locally Keycloak artifacts to avoid depending on Maven
run: |
mvn -P operator -pl operator -am clean install -DskipTests
- name: Login to Quay
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Login to Docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
logout: true
- name: Container metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
keycloak/keycloak-operator
quay.io/keycloak/keycloak-operator
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push the operator image
working-directory: operator
run: |
echo "${{ steps.meta.outputs.tags }}" | xargs -I {} \
mvn clean package \
-DskipTests \
-Dquarkus.container-image.image={} \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=true