Skip to content

Commit

Permalink
fix: ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
EndangeredF1sh committed Oct 23, 2024
1 parent 8a78879 commit de70d9a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Generate build date
id: date
run: echo "BUILD_DATE=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: Generate build date and short SHA
id: vars
run: |
echo "BUILD_DATE=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Log in to the Container registry
uses: docker/login-action@v2
Expand All @@ -48,7 +50,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=git-${{ github.sha::7 }}-${{ steps.date.outputs.BUILD_DATE }}
type=raw,value=git-${{ steps.vars.outputs.SHORT_SHA }}-${{ steps.vars.outputs.BUILD_DATE }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
Expand Down

0 comments on commit de70d9a

Please sign in to comment.