Skip to content

Commit fd25eb0

Browse files
author
marwan37
committed
Use UTC timestamp as Docker image tag in GH action workflow
1 parent 5020fa9 commit fd25eb0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/build-push-sandbox.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,18 @@ jobs:
8585
with:
8686
fetch-depth: 0
8787

88+
- name: Set image tag timestamp
89+
id: timestamp
90+
run: |
91+
echo "timestamp=$(date -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
92+
8893
- name: Check for Dockerfile.codespace
8994
id: check-dockerfile
9095
run: |
9196
if [ -f "${{ matrix.project }}/Dockerfile.codespace" ]; then
9297
echo "dockerfile_exists=true" >> $GITHUB_OUTPUT
9398
else
9499
echo "dockerfile_exists=false" >> $GITHUB_OUTPUT
95-
echo "No Dockerfile.codespace found in ${{ matrix.project }}, will generate one."
96100
fi
97101
98102
- name: Set up Python
@@ -148,6 +152,6 @@ jobs:
148152
file: ${{ matrix.project }}/Dockerfile.codespace
149153
push: true
150154
tags: |
151-
zenmldocker/projects-${{ matrix.project }}:latest
155+
zenmldocker/projects-${{ matrix.project }}:${{ steps.timestamp.outputs.timestamp }}
152156
cache-from: type=gha
153157
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)