Skip to content

Commit

Permalink
Add docker push step for native image
Browse files Browse the repository at this point in the history
  • Loading branch information
mkjsix committed Oct 16, 2024
1 parent 09cf31e commit 813b209
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/native-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Native Image
name: Native Image Snapshot

on:
push:
Expand All @@ -9,6 +9,7 @@ on:

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
os: [ubuntu-latest]
Expand All @@ -19,15 +20,42 @@ jobs:
- uses: graalvm/setup-graalvm@v1
with:
java-version: "21" # See 'Options' section below for all supported versions
distribution: "graalvm" # See 'Options' section below for all available distributions
distribution: "graalvm-community" # See 'Options' section below for all available distributions
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: "maven"
native-image-job-reports: "true"

- name: Check GraalVM and Maven
- name: Build native image
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
java --version
native-image --version
mvn --version
mvn package -Pnative -DskipTests
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and Push multi-arch native Docker images
uses: docker/build-push-action@v6
with:
context: ./core/Dockerfile.native
platforms: |
linux/amd64,
linux/arm64,
linux/ppc64le,
linux/s390x
push: true # push all images built
pull: true # pull all required images before building
# Tag with "latest" only if branch is master
tags: |
softinstigate/restheart-native:latest

0 comments on commit 813b209

Please sign in to comment.