mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-06-20 01:47:43 +02:00
Prepare universal workflow
This commit is contained in:
parent
757e8d9d10
commit
37271539bf
29
.github/workflows/images_build_windows.yml
vendored
29
.github/workflows/images_build_windows.yml
vendored
@ -198,26 +198,33 @@ jobs:
|
|||||||
$tags=$( $tags_array | Foreach-Object { "--tag=$_" } )
|
$tags=$( $tags_array | Foreach-Object { "--tag=$_" } )
|
||||||
|
|
||||||
echo "docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION --label org.opencontainers.image.created=$Env:LABEL_CREATED --build-arg=BUILD_BASE_IMAGE=$base_os_image --file=$dockerfile $tags $context"
|
echo "docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION --label org.opencontainers.image.created=$Env:LABEL_CREATED --build-arg=BUILD_BASE_IMAGE=$base_os_image --file=$dockerfile $tags $context"
|
||||||
echo "$Env:AUTO_PUSH_IMAGES"
|
|
||||||
|
|
||||||
docker pull $base_os_image
|
docker pull $base_os_image
|
||||||
|
|
||||||
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION `
|
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION `
|
||||||
--label org.opencontainers.image.created=$Env:LABEL_CREATED `
|
--label org.opencontainers.image.created=$Env:LABEL_CREATED `
|
||||||
--build-arg=BUILD_BASE_IMAGE=$base_os_image `
|
--build-arg=BUILD_BASE_IMAGE=$base_os_image `
|
||||||
|
--cache-from=type=gha,scope=$tags_array[0] `
|
||||||
|
--cache-to=type=gha,mode=max,scope=$tags_array[0] `
|
||||||
--file=$dockerfile `
|
--file=$dockerfile `
|
||||||
$tags `
|
$tags `
|
||||||
$context
|
$context
|
||||||
if (-not $?) {throw "Failed"}
|
if (-not $?) {throw "Failed"}
|
||||||
|
|
||||||
Foreach ($tag in $tags_array) {
|
if ( $Env:AUTO_PUSH_IMAGES -eq 'true' ) {
|
||||||
echo "docker image push $tag"
|
Foreach ($tag in $tags_array) {
|
||||||
docker image push $tag
|
echo "docker image push $tag"
|
||||||
|
docker image push $tag
|
||||||
|
if (-not $?) {throw "Failed"}
|
||||||
|
}
|
||||||
|
|
||||||
|
$digest=$(docker inspect $tags_array[0] --format "{{ index .RepoDigests 0}}").Split('@')[-1]
|
||||||
|
if (-not $?) {throw "Failed"}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$digest=$(docker inspect $tags_array[0] --format "{{ index .Id}}")
|
||||||
if (-not $?) {throw "Failed"}
|
if (-not $?) {throw "Failed"}
|
||||||
}
|
}
|
||||||
|
|
||||||
$digest=$(docker inspect $tags_array[0] --format "{{ index .RepoDigests 0}}").Split('@')[-1]
|
|
||||||
if (-not $?) {throw "Failed"}
|
|
||||||
|
|
||||||
echo "digest=$digest" >> $Env:GITHUB_OUTPUT
|
echo "digest=$digest" >> $Env:GITHUB_OUTPUT
|
||||||
|
|
||||||
@ -227,10 +234,10 @@ jobs:
|
|||||||
TAGS: ${{ steps.meta.outputs.tags }}
|
TAGS: ${{ steps.meta.outputs.tags }}
|
||||||
run: |
|
run: |
|
||||||
images=""
|
images=""
|
||||||
for tag in ${TAGS}; do
|
foreach ($tag in $Env:TAGS) {
|
||||||
images+="${tag}@${DIGEST} "
|
images=$images + "$tag@$Env:DIGEST "
|
||||||
done
|
}
|
||||||
cosign sign --yes ${images}
|
cosign sign --yes $images
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
if: ${{ env.AUTO_PUSH_IMAGES }}
|
if: ${{ env.AUTO_PUSH_IMAGES }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user