-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (71 loc) · 2.37 KB
/
keycloak.yml
File metadata and controls
80 lines (71 loc) · 2.37 KB
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
70
71
72
73
74
75
76
77
78
79
80
name: keycloak
env:
KEYCLOAK_VERSION: "26.2.1"
on:
push:
paths:
- frontend/keycloak-theme/**
- .github/workflows/keycloak.yml
branches: [ "**" ]
tags:
- '*.*.*'
pull_request:
paths:
- frontend/keycloak-theme/**
- .github/workflows/keycloak.yml
branches:
- main
jobs:
build:
# Verhindert doppelte Ausführung bei PRs
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
strategy:
matrix:
baseDirectory: [ "frontend/keycloak-theme" ]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine Docker image tag
id: get-version
run: |
if git describe --tags --exact-match 2>/dev/null; then
TAG=$(git describe --tags --exact-match)
echo "VERSION=${TAG}-keycloak-${KEYCLOAK_VERSION}" >> $GITHUB_ENV
else
echo "VERSION=${GITHUB_RUN_NUMBER}-keycloak-${KEYCLOAK_VERSION}" >> $GITHUB_ENV
fi
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: ${{ matrix.baseDirectory }}
file: ${{ matrix.baseDirectory }}/Dockerfile
push: ${{ !startsWith(github.ref, 'refs/heads/dependabot') }}
tags: ghcr.io/${{ github.repository }}/hopps-keycloak:${{ env.VERSION }}
- name: Trigger deploy workflow
uses: actions/github-script@v8
# only trigger deployment on main
if: ${{ github.ref == 'refs/heads/main' }}
with:
github-token: ${{ secrets.TECHNICAL_USER_PAT }}
script: |
const result = await github.rest.actions.createWorkflowDispatch({
owner: 'hopps-app',
repo: 'hopps.cloud',
workflow_id: 'deploy.yml',
ref: 'main',
inputs: {
"environment": "dev",
"new-tag": "${{ env.VERSION }}",
"service-name": "keycloak"
}
})
console.log(result);