refactor(ci): simplify DockerHub push logic to always publish using 'latest' tag
This commit is contained in:
parent
97ee055c69
commit
172ff17512
13
.github/workflows/build-base-images.yml
vendored
13
.github/workflows/build-base-images.yml
vendored
@ -123,18 +123,11 @@ jobs:
|
||||
SERVICE="${{ matrix.image.name }}"
|
||||
ORIGIN_IMG="${{ env.REGISTRY }}/${{ env.ORG }}/${SERVICE}@${{ steps.build.outputs.digest }}"
|
||||
TARGET_REPO="docker.io/${TARGET_NS}/${SERVICE}"
|
||||
TAG_NAMES="${{ steps.meta.outputs.tag-names }}"
|
||||
|
||||
TAG="latest"
|
||||
docker pull "$ORIGIN_IMG"
|
||||
|
||||
for TAG in $TAG_NAMES; do
|
||||
if [ -z "$TAGS" ]; then
|
||||
echo "TAG_NAMES is empty, falling back to 'latest'"
|
||||
TAGS="latest"
|
||||
fi
|
||||
docker tag "$ORIGIN_IMG" "$TARGET_REPO:$TAG"
|
||||
docker push "$TARGET_REPO:$TAG"
|
||||
done
|
||||
docker tag "$ORIGIN_IMG" "$TARGET_REPO:$TAG"
|
||||
docker push "$TARGET_REPO:$TAG"
|
||||
|
||||
Security-service:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
13
.github/workflows/build-service-images.yml
vendored
13
.github/workflows/build-service-images.yml
vendored
@ -158,18 +158,11 @@ jobs:
|
||||
SERVICE="${{ matrix.service.name }}"
|
||||
ORIGIN_IMG="${{ env.REGISTRY }}/${{ env.ORG }}/${SERVICE}@${{ steps.build.outputs.digest }}"
|
||||
TARGET_REPO="docker.io/${TARGET_NS}/${SERVICE}"
|
||||
TAG_NAMES="${{ steps.meta.outputs.tag-names }}"
|
||||
|
||||
TAG="latest"
|
||||
docker pull "$ORIGIN_IMG"
|
||||
|
||||
for TAG in $TAG_NAMES; do
|
||||
if [ -z "$TAGS" ]; then
|
||||
echo "TAG_NAMES is empty, falling back to 'latest'"
|
||||
TAGS="latest"
|
||||
fi
|
||||
docker tag "$ORIGIN_IMG" "$TARGET_REPO:$TAG"
|
||||
docker push "$TARGET_REPO:$TAG"
|
||||
done
|
||||
docker tag "$ORIGIN_IMG" "$TARGET_REPO:$TAG"
|
||||
docker push "$TARGET_REPO:$TAG"
|
||||
|
||||
Security:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Loading…
Reference in New Issue
Block a user