Skip to content

Commit 58085be

Browse files
Update docker-build.yml
1 parent 63effa3 commit 58085be

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

.github/workflows/docker-build.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ name: Build and Push Docker Images
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:
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:
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:
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 }}

0 commit comments

Comments
 (0)