Skip to content

.github/workflows/release.yml #91

.github/workflows/release.yml

.github/workflows/release.yml #91

Workflow file for this run

on:
push:
branches: [ "*" ]
tags: [ "*" ]
schedule:
- cron: "0 10 * * 1"
env:
REGISTRY: "ghcr.io"
IMAGE_NAME: "${{ github.repository }}"
JDK_VERSION: "17"
KEYCLOAK_VERSION: "1.2.0-kc21.1.1"
jobs:
build-provider-theme:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "17"
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('providers/theme/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build theme provider
run: mvn -f providers/theme/pom.xml clean package -Drevision=${GITHUB_REF_NAME}
- name: Archive theme provider jarfile
uses: actions/upload-artifact@v4
with:
name: keycloak-mangadex-theme-${{ github.ref_name }}.jar
path: providers/theme/target/keycloak-mangadex-theme-${{ github.ref_name }}.jar
build-keycloak:
needs: [ "build-provider-theme" ]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- target: keycloak-pgsql
tag_suffix: "pgsql"
- target: keycloak-pgsql-k8s
tag_suffix: "pgsql-k8s"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download theme provider
uses: actions/download-artifact@v4
with:
name: keycloak-mangadex-theme-${{ github.ref_name }}.jar
path: providers/theme/target/keycloak-mangadex-theme-${{ github.ref_name }}.jar
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
suffix=-${{ matrix.tag_suffix }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
target: ${{ matrix.target }}
build-args: |
JDK_VERSION=${{ env.JDK_VERSION }}
KEYCLOAK_VERSION=${{ env.KEYCLOAK_VERSION }}
PROVIDER_VERSION=${{ github.ref_name }}