Skip to content

Commit

Permalink
Migrate to buildpacks for native builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubois committed Nov 22, 2023
1 parent 03a8fa9 commit 2f34b2d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 57 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish-jvm-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- name: Build the JVM-based Docker image
uses: docker/build-push-action@v5
with:
file: ./src/main/docker/Dockerfile.jvm
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
49 changes: 4 additions & 45 deletions .github/workflows/publish-native-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,51 +26,6 @@ jobs:
with:
images: ${{ env.DOCKER_IMAGE_NAME }}

- uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm'
java-version: '21'
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'maven'

- name: Build application with GraalVM
# to test the GraalVM Build using DevContainers, install GraalVM by running `sdk install java 21.0.1-graal`
run: |
./mvnw -Pnative native:compile -DskipTests
- name: Login to Docker Registry
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
uses: docker/[email protected]
id: login-hub
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Build the native (GraalVM) Docker image
uses: docker/build-push-action@v5
with:
file: ./src/main/docker/Dockerfile.native
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build_native_buildpacks_docker_image:
name: Build and publish the native (GraalVM) Docker image
runs-on: ubuntu-22.04
env:
DOCKER_IMAGE_NAME: '${{ github.repository_owner }}/jhipster-lite-native-buildpacks'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand All @@ -92,6 +47,10 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Tag the native (GraalVM) Docker image
run: |
docker tag ${{ env.DOCKER_IMAGE_NAME }} ${{ steps.meta.outputs.tags }}
- name: Push the native (GraalVM) Docker image
run: |
docker push --all-tags ${{ env.DOCKER_IMAGE_NAME }}
File renamed without changes.
11 changes: 0 additions & 11 deletions src/main/docker/Dockerfile.native

This file was deleted.

0 comments on commit 2f34b2d

Please sign in to comment.