feat: docker and versioning stuff
This commit is contained in:
@@ -24,19 +24,15 @@ jobs:
|
||||
id: version
|
||||
shell: bash
|
||||
run: |
|
||||
version="$(tr -d '[:space:]' < VERSION)"
|
||||
version="$(git rev-parse --short=12 HEAD)"
|
||||
|
||||
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([-.+][0-9A-Za-z.-]+)?$ ]]; then
|
||||
echo "Invalid VERSION value: $version" >&2
|
||||
if [[ ! "$version" =~ ^[0-9a-f]{12}$ ]]; then
|
||||
echo "Invalid git hash version: $version" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker_tag="${version//+/-}"
|
||||
short_sha="${GITHUB_SHA::7}"
|
||||
|
||||
echo "value=$version" >> "$GITHUB_OUTPUT"
|
||||
echo "docker_tag=$docker_tag" >> "$GITHUB_OUTPUT"
|
||||
echo "dev_tag=${docker_tag}-dev.${short_sha}" >> "$GITHUB_OUTPUT"
|
||||
echo "docker_tag=$version" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
@@ -59,7 +55,6 @@ jobs:
|
||||
VCS_REF=${{ github.sha }}
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.dev_tag }}
|
||||
labels: |
|
||||
org.opencontainers.image.version=${{ steps.version.outputs.value }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
|
||||
Reference in New Issue
Block a user