From 35bf6087bb4607971546a28a8d7c0b99d328d78d Mon Sep 17 00:00:00 2001 From: cruizba Date: Fri, 26 Jan 2024 22:01:49 +0100 Subject: [PATCH] Control versions from github yaml --- .../workflows/build-and-push-docker-image.yml | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-push-docker-image.yml b/.github/workflows/build-and-push-docker-image.yml index 307091b..961b820 100644 --- a/.github/workflows/build-and-push-docker-image.yml +++ b/.github/workflows/build-and-push-docker-image.yml @@ -3,17 +3,15 @@ name: Build and push Docker image on: release: types: [published] + workflow_dispatch: +env: + CURRENT_VERSION: 25.0.0 + BUILD_NUMBER: 0 jobs: docker: runs-on: ubuntu-latest steps: - - name: Generate version - run: | - VERSION=$(echo "${{ github.ref_name }}" - DATE=$(date +%Y%m%d%H%M%S) - echo "DATE_TAG=${VERSION}-${DATE}" >> $GITHUB_ENV - echo "TAG=${VERSION}" >> $GITHUB_ENV - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -33,8 +31,8 @@ jobs: file: ubuntu-focal.Dockerfile platforms: linux/amd64,linux/arm64 tags: > - cruizba/ubuntu-dind:focal-${{ env.TAG }}, - cruizba/ubuntu-dind:focal-${{ env.DATE_TAG }} + cruizba/ubuntu-dind:focal-${{ env.CURRENT_VERSION }}, + cruizba/ubuntu-dind:focal-${{ env.CURRENT_VERSION }}-r${{ env.BUILD_NUMBER }} - name: Ubuntu 22.04 - Build and push uses: docker/build-push-action@v5 @@ -43,8 +41,8 @@ jobs: file: ubuntu-jammy.Dockerfile platforms: linux/amd64,linux/arm64 tags: > - cruizba/ubuntu-dind:jammy-${{ env.TAG }}, - cruizba/ubuntu-dind:jammy-${{ env.DATE_TAG }} + cruizba/ubuntu-dind:jammy-${{ env.CURRENT_VERSION }}, + cruizba/ubuntu-dind:jammy-${{ env.CURRENT_VERSION }}-r${{ env.BUILD_NUMBER }} cruizba/ubuntu-dind:latest - name: Ubuntu 24.04 - Build and push @@ -54,5 +52,5 @@ jobs: file: ubuntu-noble.Dockerfile platforms: linux/amd64,linux/arm64 tags: > - cruizba/ubuntu-dind:noble-${{ env.TAG }}, - cruizba/ubuntu-dind:noble-${{ env.DATE_TAG }} + cruizba/ubuntu-dind:noble-${{ env.CURRENT_VERSION }}, + cruizba/ubuntu-dind:noble-${{ env.CURRENT_VERSION }}-r${{ env.BUILD_NUMBER }}