mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
chore(docker): improve workflow for version retrieval
This commit is contained in:
parent
ec0df6f66b
commit
cf89d1c4f5
1 changed files with 10 additions and 4 deletions
14
.github/workflows/docker.yml
vendored
14
.github/workflows/docker.yml
vendored
|
|
@ -47,14 +47,20 @@ jobs:
|
||||||
id: image_info
|
id: image_info
|
||||||
run: |
|
run: |
|
||||||
# Extract version information
|
# Extract version information
|
||||||
|
VERSION=""
|
||||||
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
||||||
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
VERSION="${{ github.ref_name }}"
|
||||||
elif [[ "${{ github.ref }}" == refs/heads/main ]]; then
|
elif [[ "${{ github.ref }}" == refs/heads/main ]]; then
|
||||||
echo "VERSION=latest" >> $GITHUB_OUTPUT
|
VERSION="latest"
|
||||||
else
|
|
||||||
echo "VERSION=" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$VERSION" ]; then
|
||||||
|
echo "Error: Could not determine version from ref '${{ github.ref }}'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# Get the digest of the pushed image. The --format option can be unreliable,
|
# Get the digest of the pushed image. The --format option can be unreliable,
|
||||||
# so we parse the full JSON output to find the digest of the manifest list.
|
# so we parse the full JSON output to find the digest of the manifest list.
|
||||||
MANIFEST_JSON=$(docker buildx imagetools inspect ghcr.io/berachain/bera-geth:${VERSION})
|
MANIFEST_JSON=$(docker buildx imagetools inspect ghcr.io/berachain/bera-geth:${VERSION})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue