diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index f62d6e0..ca72c83 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -41,6 +41,7 @@ jobs: platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV echo "SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "TIMESTAMP=$(date '+%Y%m%d%H%M%S')" >> $GITHUB_ENV - name: Docker meta id: meta @@ -48,7 +49,6 @@ jobs: with: images: ${{ env.REGISTRY_IMAGE }} tags: | - latest type=schedule,pattern={{date 'YYYYMMDD'}} type=sha @@ -68,7 +68,7 @@ jobs: id: build uses: docker/build-push-action@v6 with: - tags: ${{ env.REGISTRY_IMAGE }}:latest,${{ env.REGISTRY_IMAGE }}:${{ env.SHA }} + tags: ${{ env.REGISTRY_IMAGE }}:${{env.TIMESTAMP}},${{ env.REGISTRY_IMAGE }}:${{ env.SHA }} platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true @@ -107,6 +107,7 @@ jobs: platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV echo "SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "TIMESTAMP=$(date '+%Y%m%d%H%M%S')" >> $GITHUB_ENV - name: Docker meta id: meta @@ -114,10 +115,9 @@ jobs: with: images: ${{ env.REGISTRY_IMAGE }} tags: | - latest - type=schedule,pattern={{date 'YYYYMMDD'}} + type=schedule,pattern={{date 'YYYYMMDDhhmmss'}} type=sha - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -138,7 +138,7 @@ jobs: platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true - tags: ${{ env.REGISTRY_IMAGE }}:latest,${{ env.REGISTRY_IMAGE }}:${{ env.SHA }} + tags: ${{ env.REGISTRY_IMAGE }}:${{env.TIMESTAMP}},${{ env.REGISTRY_IMAGE }}:${{ env.SHA }} - name: Export digest run: | @@ -176,6 +176,10 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY_IMAGE }} + tags: | + type=schedule,pattern={{date 'YYYYMMDDhhmmss'}} + type=sha + - name: Login to Docker Hub uses: docker/login-action@v3