History

Update docker-build.yml

Chaitanya Rahalkar committed 1 year ago

Commit 58085be1 parent 63effa31 file · +3 −8Browse files

Unified · Split

.github/workflows/docker-build.yml+3−8
@@ -2,11 +2,10 @@ name: Build and Push Docker Images · 1 unmodified line
22 on:
33 schedule:
44 - cron: '0 0 1 * *' # Run monthly on the 1st
5− workflow_dispatch:
5+ workflow_dispatch: # Allow manual triggers
66 env:
77 REGISTRY: ghcr.io
88 IMAGE_NAME: ${{ github.repository }}
9− TAG_DATE: ${{ format('{0}{1}{2}', github.event.repository.pushed_at.substring(0,4), github.event.repository.pushed_at.substring(5,7), github.event.repository.pushed_at.substring(8,10)) }}
109 jobs:
1110 build-and-push:
1211 runs-on: ubuntu-latest
@@ -16,10 +15,6 @@ jobs: · 3 unmodified lines
1615 steps:
1716 - name: Checkout repository
1817 uses: actions/checkout@v4
19−
20− - name: Set current date
21− id: date
22− run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
2318
2419 - name: Log in to the Container registry
2520 uses: docker/login-action@v3
@@ -35,7 +30,7 @@ jobs: · 9 unmodified lines
3530 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3631 tags: |
3732 type=raw,value=latest
38− type=raw,value=${{ env.DATE }}
33+ type=raw,value={{date 'YYYYMMDD'}}
3934
4035 - name: Build and push regular image
4136 uses: docker/build-push-action@v5
@@ -54,5 +49,5 @@ jobs: · 12 unmodified lines
5449 push: true
5550 tags: |
5651 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alpine
57− ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alpine-${{ env.DATE }}
52+ ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alpine-{{date 'YYYYMMDD'}}
5853 labels: ${{ steps.meta.outputs.labels }}