mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
Allow finer control of pushing images
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
6780afbed1
commit
2623e8a707
20
.github/workflows/image.yaml
vendored
20
.github/workflows/image.yaml
vendored
@ -100,16 +100,20 @@ jobs:
|
|||||||
echo "${REPO_FULL_NAME}"
|
echo "${REPO_FULL_NAME}"
|
||||||
echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV
|
echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
GENERATE_ARTIFACTS="false"
|
PUSH_ON_BUILD="false"
|
||||||
if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then
|
BUILD_MULTI_ARCH_IMAGES="false"
|
||||||
GENERATE_ARTIFACTS="false"
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then
|
if [[ "${{ github.actor }}" != "dependabot[bot]" && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then
|
||||||
GENERATE_ARTIFACTS="true"
|
# For non-fork PRs that are not created by dependabot we do push images
|
||||||
|
PUSH_ON_BUILD="true"
|
||||||
|
fi
|
||||||
elif [[ "${{ github.event_name }}" == "push" ]]; then
|
elif [[ "${{ github.event_name }}" == "push" ]]; then
|
||||||
GENERATE_ARTIFACTS="true"
|
# On push events we do generate images and enable muilti-arch builds
|
||||||
|
PUSH_ON_BUILD="true"
|
||||||
|
BUILD_MULTI_ARCH_IMAGES="true"
|
||||||
fi
|
fi
|
||||||
echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
|
echo "PUSH_ON_BUILD=${PUSH_ON_BUILD}" >> $GITHUB_ENV
|
||||||
echo "BUILD_MULTI_ARCH_IMAGES=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
|
echo "BUILD_MULTI_ARCH_IMAGES=${BUILD_MULTI_ARCH_IMAGES}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
Loading…
Reference in New Issue
Block a user