-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,49 @@ | ||
name: Docker CI | ||
name: Build JAR in Container | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: write | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ghcr.io/${{ github.repository }}:${{ github.sha }} | ||
|
||
- name: List files in dist_keycloak | ||
run: ls -l | ||
|
||
- name: Upload dist_keycloak artifacts to release | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist_keycloak-artifacts | ||
path: ./dist_keycloak/keycloak-theme-for-kc-22-and-above.jar | ||
if-no-files-found: warn | ||
|
||
- name: Add git note | ||
run: | | ||
git config --global user.email "[email protected]" | ||
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 | ||
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 | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: false # Don't push the Docker image | ||
tags: 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-and-above.jar /dist/keycloak-theme-for-kc-22-and-above.jar | ||
|
||
- name: List files in dist_keycloak | ||
run: ls -l ./dist_keycloak | ||
|
||
- name: Upload dist_keycloak artifacts to release | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist_keycloak-artifacts | ||
path: ./dist_keycloak/keycloak-theme-for-kc-22-and-above.jar | ||
if-no-files-found: warn | ||
|
||
- name: Add git note | ||
run: | | ||
git config --global user.email "[email protected]" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters