This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Keycloak, Create Release and Publish Docker Image | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release_and_publish: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Bump version and push tag | |
id: tag | |
uses: anothrNick/github-tag-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: false | |
DEFAULT_BUMP: patch | |
- name: Set version | |
run: ./set-version.sh ${{ steps.tag.outputs.new_tag }} | |
- name: Build Keycloak | |
uses: ./.github/actions/build-keycloak | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: quarkus/dist/target/keycloak-*.tar.gz | |
tag_name: ${{ steps.tag.outputs.new_tag }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./quarkus/container/ | |
file: ./quarkus/container/Dockerfile | |
push: true | |
tags: ghcr.io/vunetsystems/keycloak:${{ steps.tag.outputs.new_tag }} | |
build-args: | | |
KEYCLOAK_VERSION=${{ steps.tag.outputs.new_tag }} |