@@ -57,28 +57,33 @@ jobs:
5757 - name : Compare versions and decide whether to build
5858 run : |
5959 if [ "${{ env.VERSION }}" == "${{ env.DOCKER_VERSION }}" ]; then
60- echo "No update needed. Exiting."
61- exit 0
60+ echo "NO_UPDATE=true" >> $GITHUB_ENV
61+ echo "No update needed. Skipping build."
6262 else
63+ echo "NO_UPDATE=false" >> $GITHUB_ENV
6364 echo "New version detected: ${{ env.VERSION }} (Latest Docker version: ${{ env.DOCKER_VERSION }})"
6465 fi
6566
6667 # Enable QEMU for multi-platform builds
6768 - name : Set up QEMU
69+ if : env.NO_UPDATE == 'false'
6870 uses : docker/setup-qemu-action@v3
6971
7072 # Enable Buildx for advanced Docker builds
7173 - name : Set up Docker Buildx
74+ if : env.NO_UPDATE == 'false'
7275 uses : docker/setup-buildx-action@v3
7376
7477 # Set date variable for image tags
7578 - name : Set the date variable
79+ if : env.NO_UPDATE == 'false'
7680 run : |
7781 DATE=$(date +%Y%m%d) # Get the current date in yyyyMMdd format
7882 echo "DATE=$DATE" >> $GITHUB_ENV
7983
8084 # Build and push the Docker image for multiple platforms
8185 - name : Build and push Docker image
86+ if : env.NO_UPDATE == 'false'
8287 run : |
8388 IMAGE_TAG="${{ env.VERSION }}-${{ env.DATE }}"
8489 docker buildx build --platform linux/amd64,linux/arm64/v8 \
8893
8994 # Tag the Git repository with the new version and push the tag
9095 - name : Tag and push Git version
96+ if : env.NO_UPDATE == 'false'
9197 run : |
9298 IMAGE_TAG="${{ env.VERSION }}-${{ env.DATE }}"
9399 git config --global user.email "${{ github.actor }}@users.noreply.github.com"
94100 git config --global user.name "${{ github.actor }}"
95101 git tag "${IMAGE_TAG}" -a -m "jotta-cli ${{ env.VERSION }}"
96- git push --tags
102+ git push --tags
0 commit comments