Skip to content

Commit

Permalink
Improve workflow 5
Browse files Browse the repository at this point in the history
  • Loading branch information
antlafarge committed Jun 28, 2024
1 parent 4b2dcbf commit 407b890
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions .github/workflows/dockerhub-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ concurrency:

jobs:
Release:
strategy:
matrix:
openjdkVersion: [openjdk8, openjdk17, openjdk21]
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
Expand All @@ -23,25 +26,18 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: pull and retag
- name: alpine-${{ matrix.openjdkVersion }}, ubuntu-${{ matrix.openjdkVersion }}, ${{ matrix.openjdkVersion }}
run: |
docker pull ${{ env.IMAGE_NAME }}:dev-alpine-openjdk8
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-alpine-openjdk8 -t ${{ env.IMAGE_NAME }}:alpine-openjdk8
docker pull ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk8
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk8 -t ${{ env.IMAGE_NAME }}:ubuntu-openjdk8
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk8 -t ${{ env.IMAGE_NAME }}:openjdk8
docker pull ${{ env.IMAGE_NAME }}:dev-alpine-openjdk17
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-alpine-openjdk17 -t ${{ env.IMAGE_NAME }}:alpine-openjdk17
docker pull ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk17
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk17 -t ${{ env.IMAGE_NAME }}:ubuntu-openjdk17
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk17 -t ${{ env.IMAGE_NAME }}:openjdk17
docker pull ${{ env.IMAGE_NAME }}:dev-alpine-openjdk21
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-alpine-openjdk21 -t ${{ env.IMAGE_NAME }}:alpine-openjdk21
docker pull ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk21
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk21 -t ${{ env.IMAGE_NAME }}:ubuntu-openjdk21
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk21 -t ${{ env.IMAGE_NAME }}:openjdk21
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-alpine-openjdk21 -t ${{ env.IMAGE_NAME }}:alpine
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk21 -t ${{ env.IMAGE_NAME }}:ubuntu
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-openjdk21 -t ${{ env.IMAGE_NAME }}:latest
docker pull ${{ env.IMAGE_NAME }}:dev-alpine-${{ matrix.openjdkVersion }}
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-alpine-${{ matrix.openjdkVersion }} -t ${{ env.IMAGE_NAME }}:alpine-${{ matrix.openjdkVersion }}
docker pull ${{ env.IMAGE_NAME }}:dev-ubuntu-${{ matrix.openjdkVersion }}
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-${{ matrix.openjdkVersion }} -t ${{ env.IMAGE_NAME }}:ubuntu-${{ matrix.openjdkVersion }}
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-${{ matrix.openjdkVersion }} -t ${{ env.IMAGE_NAME }}:${{ matrix.openjdkVersion }}
- name: alpine, ubuntu, latest
if: ${{ matrix.openjdkVersion == 'openjdk21' }}
run: |
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-alpine-${{ matrix.openjdkVersion }} -t ${{ env.IMAGE_NAME }}:alpine
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-${{ matrix.openjdkVersion }} -t ${{ env.IMAGE_NAME }}:ubuntu
docker buildx imagetools create ${{ env.IMAGE_NAME }}:dev-ubuntu-${{ matrix.openjdkVersion }} -t ${{ env.IMAGE_NAME }}:latest
- name: Logout from Docker Hub
run: docker logout

0 comments on commit 407b890

Please sign in to comment.