Skip to content

Commit fa85997

Browse files
authored
Create testimage.yaml
1 parent 78a1cc8 commit fa85997

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/testimage.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test Image Exists
2+
3+
on:
4+
workflow_dispatch: # Allows you to trigger this manually from GitHub UI
5+
6+
env:
7+
REGISTRY: nvcr.io
8+
REPO: nvstaging/mellanox/network-operator
9+
TAG: v25.4.0-beta.1 # You can change this or pass via workflow input
10+
11+
jobs:
12+
check-image:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Install skopeo
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y skopeo
20+
21+
- name: Login to registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ secrets.NVCR_USERNAME }}
26+
password: ${{ secrets.NVCR_TOKEN }}
27+
28+
- name: Check if image exists
29+
run: |
30+
IMAGE="docker://${{ env.REGISTRY }}/${{ env.REPO }}:${{ env.TAG }}"
31+
echo "Checking for image: $IMAGE"
32+
if skopeo inspect "$IMAGE" > /dev/null 2>&1; then
33+
echo "✅ Image exists!"
34+
else
35+
echo "❌ Image does not exist."
36+
exit 1
37+
fi

0 commit comments

Comments
 (0)