From c4c7249000a4cecf4b1a29dbc3d15c41148a9ca9 Mon Sep 17 00:00:00 2001 From: swissbuechi Date: Fri, 10 Nov 2023 13:24:39 +0100 Subject: [PATCH] refactoring --- .../{build-artifact.yml => artifact-build-native.yml} | 10 +++++----- .../{build-image.yml => docker-build-image.yml} | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) rename .github/workflows/{build-artifact.yml => artifact-build-native.yml} (84%) rename .github/workflows/{build-image.yml => docker-build-image.yml} (92%) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/artifact-build-native.yml similarity index 84% rename from .github/workflows/build-artifact.yml rename to .github/workflows/artifact-build-native.yml index 5a67ca9..4610db7 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/artifact-build-native.yml @@ -1,12 +1,12 @@ -name: Build binary artifacts +name: Artifacts native build and upload on: release: - types: [ published ] + types: [published] jobs: build: - name: Build binary ${{ matrix.asset_name }} on ${{ matrix.os }} + name: Build artifact ${{ matrix.asset_name }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -33,10 +33,10 @@ jobs: components: native-image github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Build native binary + - name: Build artifact run: mvn -Pnative native:compile -DskipTests=true - - name: Upload binaries to release + - name: Upload artifact to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-image.yml b/.github/workflows/docker-build-image.yml similarity index 92% rename from .github/workflows/build-image.yml rename to .github/workflows/docker-build-image.yml index 61ee55b..65e09ba 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/docker-build-image.yml @@ -1,8 +1,9 @@ -name: Build Docker image +name: Docker image build and push on: release: - types: [ published ] + types: [published] + push: permissions: contents: read @@ -10,8 +11,8 @@ permissions: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + jobs: build: name: Build Docker image ${{ matrix.type }} @@ -52,6 +53,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . + push: ${{ github.event_name == 'release' }} file: ${{ matrix.dockerfile }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file