Prepare universal workflow

This commit is contained in:
Alexey Pustovalov 2024-02-11 21:04:33 +09:00
parent 28d105ffbc
commit 8a65ef82f6

View File

@ -858,6 +858,22 @@ jobs:
"$BASE_IMAGE"
echo "::endgroup::"
- name: Prepare cache data
id: cache_data
env:
BASE_IMAGE_TAG: ${{ steps.base_build.outputs.base_build_image }}
run: |
cache_images=""
if [[ ! -z "$BASE_IMAGE_TAG" ]]; then
cache_images="type=gha,scope=$BASE_IMAGE_TAG\ntype=registry,ref=$BASE_IMAGE_TAG"
fi
echo "::group::Base images cache"
echo "$cache_images"
echo "::endgroup::"
echo "cache_from=$cache_images" >> $GITHUB_OUTPUT
- name: Build and push image
id: docker_build
uses: docker/build-push-action@v5
@ -871,9 +887,7 @@ jobs:
labels: |
org.opencontainers.image.revision=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
org.opencontainers.image.created=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
cache-from: |
type=gha,scope=${{ steps.base_build.outputs.base_build_image }}
type=registry,ref=${{ steps.base_build.outputs.base_build_image }}
cache-from: ${{ steps.cache_data.outputs.cache_from }}
- name: Sign the images with GitHub OIDC Token
env: