Skip to content

Commit

Permalink
Update keycloak.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
richturner authored Apr 3, 2022
1 parent a67f398 commit 3d88fc8
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,70 @@ on:
release:
types: [published]

# Trigger on push for latest build ignoring tag pushes
# Push excluding tags and workflow changes
push:
tags:
- '!**'
branches:
- main

# Manually trigger for a release
workflow_dispatch:
inputs:
tag:
description: 'What tag should be used for the release.'
required: true
- main
tags-ignore:
- '*.*'
paths-ignore:
- '**/*.md'

jobs:

image_keycloak:

env:
PLATFORM: linux/amd64,linux/arm64
TAG: latest

runs-on: ubuntu-latest

steps:
- uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}

- name: Set tags
run: |
if [ -z "$TAG" ]; then
echo "TAG=-t openremote/keycloak:develop" >> $GITHUB_ENV
else
echo "TAG=-t openremote/keycloak:latest -t openremote/keycloak:$TAG" >> $GITHUB_ENV
fi
env:
TAG: ${{ github.event.release.tag_name }}

- uses: actions/checkout@v2
- name: Set tag
run: echo "TAG=${{ github.event.release.tag_name || github.event.inputs.tag || env.TAG }}" >> $GITHUB_ENV

- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: grant execute permission for gradlew
run: chmod +x gradlew

- name: build with Gradle
run: ./gradlew installDist

- name: set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: install buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
install: true

- name: available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: login to docker hub
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USER }}" --password-stdin

- name: build and push images
run: |
docker build --build-arg GIT_COMMIT=${{ github.sha }} --push --platform $PLATFORM -t openremote/keycloak:$TAG .
docker build --build-arg GIT_COMMIT=${{ github.sha }} --push --platform $PLATFORM $TAG .

0 comments on commit 3d88fc8

Please sign in to comment.