Skip to content

Commit

Permalink
set date as image tag (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
glitchcrab authored Aug 22, 2024
1 parent 6e9c580 commit c8a9ef8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,18 @@ jobs:
username: ${{ env.IMAGE_OWNER }}
password: ${{ secrets.DOCKERHUB_TOKEN_UBUNTU }}

- name: Set current date as env variable
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{raw}}
type=schedule,pattern={{date 'YYYYMMDD'}}
type=raw,value=latest
type=raw,value=$DATE
- name: Build and push Docker image
id: build-and-push
Expand Down Expand Up @@ -82,14 +85,17 @@ jobs:
username: ${{ env.IMAGE_OWNER }}
password: ${{ secrets.DOCKERHUB_TOKEN_UBUNTU }}

- name: Set current date as env variable
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
type=raw,value=latest
type=raw,value=$DATE
- name: Build and push Docker image
id: build-and-push
Expand Down

0 comments on commit c8a9ef8

Please sign in to comment.