Skip to content

Commit cb5f1dc

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

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,39 @@ 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.8.2
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: Set environment variables
333+
id: vars
334+
run: |
335+
COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}
336+
LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')
337+
echo "OPERATOR_VERSION=${COMMIT_SHORT_SHA}" >> $GITHUB_ENV
338+
echo "OPERATOR_IMAGE=ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator" >> $GITHUB_ENV
339+
echo "VALIDATOR_VERSION=${COMMIT_SHORT_SHA}" >> $GITHUB_ENV
340+
echo "VALIDATOR_IMAGE=ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator/gpu-operator-validator" >> $GITHUB_ENV
341+
- name: Retag gpu-operator and gpu-operator-validator
342+
run: |
343+
regctl registry login ghcr.io -u $GITHUB_ACTOR -p ${{ secrets.GITHUB_TOKEN }}
344+
regctl image copy ${OPERATOR_IMAGE}:${OPERATOR_VERSION} ${OPERATOR_IMAGE}:main-latest
345+
regctl image copy ${VALIDATOR_IMAGE}:${VALIDATOR_VERSION} ${VALIDATOR_IMAGE}:main-latest
346+
347+
push-gpu-operator-bundle-image:
348+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Runs only if the event is a push to the main branch
349+
needs: [release-latest-gpu-operator-and-validator-image]
350+
runs-on: linux-amd64-cpu4
322351
steps:
323352
- uses: actions/checkout@v4
324353
name: Check out code

0 commit comments

Comments
 (0)