Skip to content

Commit

Permalink
chore: fix docker tags
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop authored Sep 3, 2024
1 parent 3670800 commit af87fcc
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ 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
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
latest
type=schedule,pattern={{date 'YYYYMMDD'}}
type=sha
Expand All @@ -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
Expand Down Expand Up @@ -107,17 +107,17 @@ 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
uses: docker/metadata-action@v5
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

Expand All @@ -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: |
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit af87fcc

Please sign in to comment.