Skip to content

Commit

Permalink
Publish with branch, commit hash & timestamp
Browse files Browse the repository at this point in the history
clrxbl committed Apr 22, 2024
1 parent b082819 commit b9359dd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -33,14 +33,17 @@ jobs:
run: ./gradlew prepareWorkspace --stacktrace
- name: Build with Gradle
run: ./gradlew fatBootJar --stacktrace
- name: Generate timestamp
id: timestamp
run: echo "timestamp=$(date +%s)" >> "$GITHUB_OUTPUT"
- name: Generate tag
id: tag
run: |
ts=$(date +%s)
branch=${GITHUB_REF##*/}
echo "IMAGE_ID=${branch}-${GITHUB_SHA::8}-${ts}" >> "$GITHUB_OUTPUT"
- name: Publish Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/papermc/item-converter:latest
ghcr.io/papermc/item-converter:${{ steps.timestamp.outputs.timestamp }}
ghcr.io/papermc/item-converter:${{ steps.tag.outputs.IMAGE_ID }}

0 comments on commit b9359dd

Please sign in to comment.