2022-03-11 16:19:30 +00:00
|
|
|
name: Release Keycloak Operator container
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2022-07-27 08:49:31 +00:00
|
|
|
#push:
|
|
|
|
# tags:
|
|
|
|
# - '[0-9]+.[0-9]+.[0-9]+'
|
2022-03-11 16:19:30 +00:00
|
|
|
concurrency: keycloak-operator-container-release
|
|
|
|
|
|
|
|
env:
|
|
|
|
JDK_VERSION: 11
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
if: github.repository == 'keycloak/keycloak'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-28 15:51:51 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-03-11 16:19:30 +00:00
|
|
|
|
2022-05-13 18:47:19 +00:00
|
|
|
- uses: actions/setup-java@v3
|
2022-03-11 16:19:30 +00:00
|
|
|
with:
|
2022-05-13 18:47:19 +00:00
|
|
|
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
|
2022-03-11 16:19:30 +00:00
|
|
|
|
|
|
|
- name: Login to Quay
|
2022-05-12 12:53:59 +00:00
|
|
|
uses: docker/login-action@v2
|
2022-03-11 16:19:30 +00:00
|
|
|
with:
|
|
|
|
registry: quay.io
|
|
|
|
username: ${{ secrets.QUAY_USERNAME }}
|
|
|
|
password: ${{ secrets.QUAY_TOKEN }}
|
|
|
|
|
2022-05-13 18:47:19 +00:00
|
|
|
- name: Login to Docker
|
|
|
|
uses: docker/login-action@v2
|
2022-03-11 16:19:30 +00:00
|
|
|
with:
|
2022-05-13 18:47:19 +00:00
|
|
|
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
|
2022-03-11 16:19:30 +00:00
|
|
|
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
|