Skip to content

Commit

Permalink
Use maven to push multi-arch images
Browse files Browse the repository at this point in the history
* push during build stage as a workaround for buildx
* re-tag the built snapshot if it is a release
  • Loading branch information
Blefish committed Nov 11, 2024
1 parent fdbb8ef commit c464df1
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,18 @@ jobs:
run: |
echo "app_ver=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)"
echo "app_ver=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
# Docker hub action
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Build with Maven
run: mvn -B clean integration-test package assembly:single docker:build
run: mvn -B clean integration-test package assembly:single docker:build docker:push

# github_release:
-
Expand All @@ -40,19 +49,7 @@ jobs:
commit: "master"
generateReleaseNotes: true

# Docker hub action
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: push snapshot version
run: |
echo publishing docker container $app_ver
docker push docker.io/obsidiandynamics/kafdrop:$app_ver
-
name: push latest if it's a release
if: ${{ ! endsWith( env.app_ver, '-SNAPSHOT' ) }}
run: docker push docker.io/obsidiandynamics/kafdrop:latest
run: docker buildx imagetools create docker.io/obsidiandynamics/kafdrop:$app_ver --tag docker.io/obsidiandynamics/kafdrop:latest

0 comments on commit c464df1

Please sign in to comment.