-
Notifications
You must be signed in to change notification settings - Fork 16
69 lines (61 loc) · 2.19 KB
/
feature-keycloak-ui.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Keycloak
on:
# Currently triggered by develop workflow, so this trigger is disabled for now until we can fully separate them
# pull_request:
# paths:
# - 'keycloak-ui/**'
workflow_call:
inputs:
image:
description: 'Name of the image to build'
required: false
type: string
image-tag:
description: 'Tag for the built image'
required: false
type: string
image-registry:
description: 'Docker image registry to tag and push to'
required: false
type: string
env:
IMAGE: ${{ inputs.image-name || 'lokahi-keycloak' }}
IMAGE_TAG: ${{ inputs.image-tag || github.sha }}
IMAGE_REGISTRY: ${{ inputs.image-registry || 'ghcr.io' }}
jobs:
build-docker-image:
name: Build Docker image - Keycloak
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
# Is required to call actions.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_LOGIN }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Generate Docker metadata
id: docker-metadata
uses: docker/[email protected]
with:
images: |
${{ env.IMAGE_REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE }}
tags: |
type=raw,value=${{ env.IMAGE_TAG }}
- name: Build and push image
uses: docker/build-push-action@v3
with:
push: true
context: keycloak-ui
tags: ${{ steps.docker-metadata.outputs.tags }}
cache-from: type=gha
cache-to: type=gha