Skip to content

Commit

Permalink
cd: add timestamp label to images
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonia Melgaço committed Jan 27, 2023
1 parent b4e7748 commit 37b25a5
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@ on:
- published
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-[abcehlprt]+.?[0-9]?[0-9]?'
- '[0-9]+.[0-9]+.[0-9]+-[abcehlprt]+'
jobs:
push_to_registry:
name: Publish Docker Image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: tfgco/pusher
tag_with_ref: true
- name: Get Timestamp
id: get_timestamp
run: |
echo "ISO_TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Build and Push to Docker Hub
uses: docker/build-push-action@v3
with:
push: true
tags: tfgco/pusher:${{ github.ref_name }}
labels: org.opencontainers.image.created=${{ steps.get_timestamp.outputs.ISO_TIMESTAMP }}

0 comments on commit 37b25a5

Please sign in to comment.