-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.8 KB
/
test-push-to-ngc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This workflow is intended for repository testing purposes only.
# It simulates the NGC push process and updates the launch-list.yml file
# without actually pushing to NGC.
name: Mock NGC Push and Update
on:
workflow_dispatch:
inputs:
new_tag:
description: "New tag for the image"
required: true
jobs:
mock-ngc-push:
runs-on: ubuntu-latest
container:
image: quay.io/liveaverage/ci-builder:latest
options: --user root
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Mock NGC Push
run: |
echo "Mocking push to NGC with tag: ${{ github.event.inputs.new_tag }}"
echo "nvcr.io/${{ secrets.FN_NGC_ORG }}/<image-name>:${{ github.event.inputs.new_tag }}" > latest_image.txt
- name: Update launch-list.yml with new image tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python update-launch-list.py ${{ github.event.inputs.new_tag }}
- name: Upload updated launch-list.yml
uses: actions/upload-artifact@v3
with:
name: updated-launch-list
path: launch-list.yml
commit-and-push:
needs: mock-ngc-push
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download updated launch-list.yml
uses: actions/download-artifact@v3
with:
name: updated-launch-list
- name: Commit and push if changed
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add launch-list.yml
git diff --quiet && git diff --staged --quiet || (git commit -m "tag: updated image tag to ${{ github.event.inputs.new_tag }}" && git push)