fix version in docker builds

This commit is contained in:
Christoph Haas 2021-08-24 21:00:13 +02:00
parent 7b348888d7
commit 929c95f9ae

View File

@ -26,6 +26,13 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v2
- name: Get Version
shell: bash
run: |
echo "::set-output name=identifier::$(echo ${GITHUB_REF##*/})"
echo "::set-output name=hash::$(echo ${GITHUB_SHA} | cut -c1-7)"
id: get_version
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
@ -55,8 +62,8 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_IDENTIFIER=${GITHUB_REF##*/}
BUILD_VERSION=$(echo ${GITHUB_SHA} | cut -c1-7)
BUILD_IDENTIFIER=${{ steps.get_version.outputs.identifier }}
BUILD_VERSION=${{ steps.get_version.outputs.hash }}
build-github:
name: Push Docker image to Github Container Registry
@ -69,6 +76,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get Version
shell: bash
run: |
echo "::set-output name=identifier::$(echo ${GITHUB_REF##*/})"
echo "::set-output name=hash::$(echo ${GITHUB_SHA} | cut -c1-7)"
id: get_version
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
@ -105,5 +119,5 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_IDENTIFIER=${GITHUB_REF##*/}
BUILD_VERSION=$(echo ${GITHUB_SHA} | cut -c1-7)
BUILD_IDENTIFIER=${{ steps.get_version.outputs.identifier }}
BUILD_VERSION=${{ steps.get_version.outputs.hash }}