-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ruromero <rromerom@redhat.com>
- Loading branch information
Showing
6 changed files
with
5,033 additions
and
857 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,43 +1,55 @@ | ||
name: Build | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*.*.*' | ||
env: | ||
REGISTRY: quay.io | ||
IMAGE_NAME: cloudevents-player | ||
JAVA_VERSION: '17' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: "Build native images" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up graalVM | ||
uses: graalvm/setup-graalvm@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
version: 'latest' | ||
java-version: '17' | ||
components: 'native-image' | ||
- name: Build the project | ||
install: true | ||
- name: Define tags | ||
shell: bash | ||
run: | | ||
./mvnw package -Pnative | ||
- name: Build the container image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
POM_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
VERSION=v${POM_VERSION%-SNAPSHOT} | ||
echo "docker_tag=${VERSION}" >> $GITHUB_OUTPUT | ||
id: build_tags | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
image: cloudevents-player | ||
tags: v1.2 | ||
archs: amd64, arm64 | ||
dockerfiles: | | ||
./src/main/docker/Dockerfile.native-micro | ||
- name: Push to registry | ||
id: push-to-quay | ||
uses: redhat-actions/push-to-registry@v2 | ||
java-version: ${{ env.JAVA_VERSION }} | ||
distribution: temurin | ||
cache: maven | ||
- name: Log in to Quay | ||
uses: docker/login-action@v2 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: quay.io/ruben | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ secrets.QUAY_USER }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Build the project | ||
run: | | ||
if [ ${{ github.ref }} == 'refs/heads/main' ]; then | ||
additional_tags="-Dquarkus.container-image.additional-tags=latest" | ||
fi | ||
./mvnw -B clean package -Dcontainer \ | ||
-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64 \ | ||
-Dquarkus.docker.buildx.output=type=registry \ | ||
-Dquarkus.container-image.tag=${{ steps.build_tags.outputs.docker_tag }} \ | ||
${additional_tags:-} |
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
Oops, something went wrong.