Skip to content

Commit

Permalink
allow to push images to GH container image registry
Browse files Browse the repository at this point in the history
  • Loading branch information
mswiderski committed Jun 23, 2024
1 parent 3985863 commit 3d6021c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/maven-publish-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ name: Build arm64

on:
workflow_dispatch:

inputs:
push-to-registry:
description: 'Push container to GH registry'
default: false
type: boolean
jobs:
build:

runs-on: ubuntu-latest

permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
Expand All @@ -21,3 +27,16 @@ jobs:
cache: 'maven'
- name: Build Automatiko Approval Tasks
run: mvn -B package -Pcontainer-arm64 --file pom.xml


- name: login ghcr.io
if: inputs.push-to-registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: true
- name: Build Automatiko Approval Tasks
if: inputs.push-to-registry
run: mvn -B package -Pcontainer-arm64 -Dquarkus.container-image.push=true -Dquarkus.container-image.registry=ghcr.io -Dquarkus.container-image.group=automatiko --file pom.xml
19 changes: 18 additions & 1 deletion .github/workflows/maven-publish-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ name: Build Native

on:
workflow_dispatch:

inputs:
push-to-registry:
description: 'Push container to GH registry'
default: false
type: boolean
jobs:
build:

Expand All @@ -21,3 +25,16 @@ jobs:
cache: 'maven'
- name: Build Automatiko Approval Tasks
run: mvn -B package -Pcontainer-native --file pom.xml

- name: login ghcr.io
if: inputs.push-to-registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: true
- name: Build Automatiko Approval Tasks
if: inputs.push-to-registry
run: mvn -B package -Pcontainer-native -Dquarkus.container-image.push=true -Dquarkus.container-image.registry=ghcr.io -Dquarkus.container-image.group=automatiko --file pom.xml

1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
<properties>
<quarkus.container-image.build>true</quarkus.container-image.build>
<quarkus.jib.base-jvm-image>arm64v8/eclipse-temurin:17-ubi9-minimal</quarkus.jib.base-jvm-image>
<quarkus.container-image.tag>${project.version}-arm64</quarkus.container-image.tag>
</properties>
</profile>
<profile>
Expand Down

0 comments on commit 3d6021c

Please sign in to comment.