Replace variables with gitlog
All checks were successful
Build Docker image / test (push) Successful in 32s
Build Docker image / build (push) Successful in 23s

This commit is contained in:
Roman Krček
2024-10-06 14:35:42 +02:00
parent 2da78e066a
commit 6cfc6a565c

View File

@@ -34,6 +34,12 @@ jobs:
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Get commit information
id: gitinfo
run: |
echo "::set-output name=sha::$(git log -1 --format="%H")"
echo "::set-output name=message::$(git log -1 --format="%s")"
- name: Checkout code
uses: https://github.com/actions/checkout@v4
@@ -59,6 +65,6 @@ jobs:
cache-to: "mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=${{ vars.DOCKER_IMAGE }}:cache"
cache-from: "mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=${{ vars.DOCKER_IMAGE }}:cache"
labels: |
org.opencontainers.image.revision=${{ env.GITHUB_COMMIT_SHA }}
org.opencontainers.image.source=${{ env.GITHUB_REPOSITORY }}
org.opencontainers.image.revision=${{ steps.gitinfo.outputs.sha }}
org.opencontainers.image.commit_message=${{ steps.gitinfo.outputs.message }}
org.opencontainers.image.created=${{ steps.date.outputs.date }}