Skip to content

Commit

Permalink
Add the date as a docker tag
Browse files Browse the repository at this point in the history
  • Loading branch information
sj14 committed Jun 10, 2022
1 parent ffeb104 commit 5658c26
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
--file=Dockerfile \
--tag="$IMAGE_NAME:latest" \
--tag="$IMAGE_NAME:debian" \
--tag="$IMAGE_NAME:debian-$(date --rfc-3339=date)" \
--label="org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
--label="org.opencontainers.image.revision=$GITHUB_SHA" \
--label="org.opencontainers.image.created=$(date --rfc-3339=seconds)"
Expand All @@ -48,6 +49,7 @@ jobs:
--pull=true \
--file=Dockerfile-alpine \
--tag="$IMAGE_NAME:alpine" \
--tag="$IMAGE_NAME:alpine-$(date --rfc-3339=date)" \
--label="org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
--label="org.opencontainers.image.revision=$GITHUB_SHA" \
--label="org.opencontainers.image.created=$(date --rfc-3339=seconds)"
Expand Down Expand Up @@ -76,10 +78,12 @@ jobs:
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com \
-u ${{ github.actor }} --password-stdin
TAG_DEBIAN=docker.pkg.github.com/$GITHUB_REPOSITORY/debian
TAG_ALPINE=docker.pkg.github.com/$GITHUB_REPOSITORY/alpine
TAG_DEBIAN=docker.pkg.github.com/$GITHUB_REPOSITORY/debian:latest
TAG_ALPINE=docker.pkg.github.com/$GITHUB_REPOSITORY/alpine:latest
docker tag $IMAGE_NAME:debian $TAG_DEBIAN
docker tag $TAG_DEBIAN $TAG_DEBIAN:$(date --rfc-3339=date)
docker tag $IMAGE_NAME:alpine $TAG_ALPINE
docker tag $TAG_ALPINE $TAG_ALPINE:$(date --rfc-3339=date)
docker push $TAG_DEBIAN
docker push $TAG_ALPINE
docker logout docker.pkg.github.com
Expand Down

0 comments on commit 5658c26

Please sign in to comment.