diff --git a/.github/workflows/container_build.yml b/.github/workflows/container_build.yml index e814d45..b283c6e 100644 --- a/.github/workflows/container_build.yml +++ b/.github/workflows/container_build.yml @@ -8,6 +8,8 @@ on: push: tags: - v* + branches: + - "**" env: IMAGE_NAME: fakes3pp @@ -40,6 +42,8 @@ jobs: [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') # This uses the Docker `latest` tag convention. [ "$VERSION" == "main" ] && VERSION=latest + # Use commit hash if no other applicable tag + [ "$VERSION" != "latest" ] && [[ "${{ github.ref }}" != "refs/tags/"* ]] && VERSION="commit-$GITHUB_SHA" echo IMAGE_ID=$IMAGE_ID echo VERSION=$VERSION docker tag $IMAGE_NAME $IMAGE_ID:$VERSION