Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/build-jar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build JAR in Container

on:
push:
branches: ["main","feature/ci"]
pull_request:
branches: ["main"]

jobs:
build:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build Docker image
run: docker build -t temp-image:latest .

- name: Create dist_keycloak directory
run: mkdir -p ./dist_keycloak

- name: Copy JAR file from Docker image
run: docker run --rm -v ${{ github.workspace }}/dist_keycloak:/dist temp-image:latest cp ./dist_keycloak/keycloak-theme-for-kc-22-to-25.jar /dist/keycloak-theme-for-kc-22-to-25.jar

- name: List files in dist_keycloak
run: ls -l ./dist_keycloak

- name: Upload dist_keycloak artifacts to release
uses: actions/upload-artifact@v4
with:
name: dist_keycloak-artifacts
path: ./dist_keycloak/keycloak-theme-for-kc-22-to-25.jar
if-no-files-found: warn

- name: Set Release Tag
id: set_tag
run: echo "RELEASE_TAG=release-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: Release ${{ env.RELEASE_TAG }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist_keycloak/keycloak-theme-for-kc-22-to-25.jar
asset_name: keycloak-theme-for-kc-22-to-25.jar
asset_content_type: application/java-archive

- name: Add git note
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Action"
git fetch origin "refs/notes/*:refs/notes/*"
git notes add -m "published" ${{ github.sha }}
git push origin refs/notes/commits
27 changes: 27 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use the official Maven image as the base image
FROM maven:3.8.4-openjdk-11

WORKDIR /keycloakify-starter

# Install Node.js
RUN apt-get update && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs

RUN npm i yarn -g

# Verify installations
RUN mvn -v && \
node -v && \
npm -v && \
yarn -v

# Copy the application files
COPY . .

RUN yarn
RUN yarn build-keycloak-theme

# Keep the container running
CMD ["tail", "-f", "/dev/null"]
Loading
Loading