Skip to content

Commit 353b6d8

Browse files
committed
retag commitsha to main-latest
Signed-off-by: shiva kumar <shivaku@nvidia.com>
1 parent 6171a52 commit 353b6d8

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,44 @@ jobs:
315315
path: ./logs/
316316
retention-days: 15
317317

318-
push-gpu-operator-bundle-image:
318+
release-latest-gpu-operator-and-validator-image:
319319
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Runs only if the event is a push to the main branch
320320
needs: [e2e-tests-containerd, e2e-tests-nvidiadriver]
321-
runs-on: ubuntu-latest
321+
runs-on: linux-amd64-cpu4
322+
steps:
323+
- uses: actions/checkout@v4
324+
name: Check out code
325+
- name: set-up regctl
326+
run: |
327+
export REGCTL_VERSION=v0.7.1
328+
mkdir -p bin
329+
curl -sSLo bin/regctl https://github.com/regclient/regclient/releases/download/${REGCTL_VERSION}/regctl-linux-amd64
330+
chmod a+x bin/regctl
331+
echo "$(pwd)/bin" >> $GITHUB_PATH
332+
- name: Calculate test vars
333+
id: vars
334+
run: |
335+
COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}
336+
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
337+
LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')
338+
echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV
339+
echo "OPERATOR_VERSION=${COMMIT_SHORT_SHA}" >> $GITHUB_ENV
340+
echo "OPERATOR_IMAGE=ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator" >> $GITHUB_ENV
341+
echo "VALIDATOR_VERSION=${COMMIT_SHORT_SHA}" >> $GITHUB_ENV
342+
echo "VALIDATOR_IMAGE=ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator/gpu-operator-validator" >> $GITHUB_ENV
343+
- name: Retag gpu-operator and gpu-operator-validator
344+
env:
345+
ADDITIONAL_IMAGE_TAG: ${{ github.ref_name == 'main' && 'main-latest' || '' }}
346+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
347+
run: |
348+
regctl registry login ghcr.io -u $GITHUB_ACTOR -p ${{ secrets.GITHUB_TOKEN }}
349+
regctl image copy ${OPERATOR_IMAGE}:${OPERATOR_VERSION} ${OPERATOR_IMAGE}:${ADDITIONAL_IMAGE_TAG}
350+
regctl image copy ${VALIDATOR_IMAGE}:${VALIDATOR_VERSION} ${VALIDATOR_IMAGE}:${ADDITIONAL_IMAGE_TAG}
351+
352+
push-gpu-operator-bundle-image:
353+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Runs only if the event is a push to the main branch
354+
needs: [release-latest-gpu-operator-and-validator-image]
355+
runs-on: linux-amd64-cpu4
322356
steps:
323357
- uses: actions/checkout@v4
324358
name: Check out code

0 commit comments

Comments
 (0)