Skip to content

Commit d0780f7

Browse files
committed
retag commitsha to main-latest
Signed-off-by: shiva kumar <shivaku@nvidia.com>
1 parent 43ec029 commit d0780f7

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

.github/workflows/ci.yaml

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

318-
push-gpu-operator-bundle-image:
318+
gpu-operator-and-validator-image-retag:
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: Login to GitHub Container Registry
326+
uses: docker/login-action@v3
327+
with:
328+
registry: ghcr.io
329+
username: ${{ github.actor }}
330+
password: ${{ secrets.GITHUB_TOKEN }}
331+
- name: Calculate test vars
332+
id: vars
333+
run: |
334+
COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}
335+
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
336+
LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')
337+
echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV
338+
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+
run: |
347+
docker pull ${OPERATOR_IMAGE}:${OPERATOR_VERSION}
348+
docker pull ${VALIDATOR_IMAGE}:${VALIDATOR_VERSION}
349+
docker tag ${OPERATOR_IMAGE}:${OPERATOR_VERSION} ${OPERATOR_IMAGE}:${ADDITIONAL_IMAGE_TAG}
350+
docker push ${OPERATOR_IMAGE}:${ADDITIONAL_IMAGE_TAG}
351+
docker tag ${VALIDATOR_IMAGE}:${VALIDATOR_VERSION} ${VALIDATOR_IMAGE}:${ADDITIONAL_IMAGE_TAG}
352+
docker push ${VALIDATOR_IMAGE}:${ADDITIONAL_IMAGE_TAG}
353+
354+
355+
push-gpu-operator-bundle-image:
356+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Runs only if the event is a push to the main branch
357+
needs: [gpu-operator-and-validator-image-retag]
358+
runs-on: linux-amd64-cpu4
322359
steps:
323360
- uses: actions/checkout@v4
324361
name: Check out code

0 commit comments

Comments
 (0)