Skip to content

Commit 9612940

Browse files
committed
ci: promote docker images if nightly builds work
1 parent d792d38 commit 9612940

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/nightly_docker_test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Nightly Server test - Latest build
22
on:
33
workflow_dispatch:
4+
inputs:
5+
promote:
6+
description: 'Promote the latest build to stable'
7+
required: false
8+
default: false
9+
type: boolean
410
schedule: # UTC at 0300
511
- cron: "0 3 * * *"
612
# Trigger workflow when file is modified
@@ -200,3 +206,51 @@ jobs:
200206
}
201207
]
202208
}
209+
210+
promote-windows:
211+
needs: [windows-tests, linux-tests]
212+
runs-on: [self-hosted, Windows, pygeometry]
213+
if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }}
214+
env:
215+
WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:windows-latest-unstable
216+
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
217+
steps:
218+
- name: Login in Github Container registry
219+
uses: docker/login-action@v3
220+
with:
221+
registry: ghcr.io
222+
username: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
223+
password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
224+
225+
- name: Pull Windows latest unstable container
226+
run: docker pull ${{ env.WINDOWS_UNSTABLE }}
227+
228+
- name: Tag container as latest (stable) for Github Container registry
229+
run: docker tag ${{ env.WINDOWS_UNSTABLE }} ${{ env.WINDOWS_STABLE_GHCR }}
230+
231+
- name: Publish latest stable container in ghcr.io
232+
run: docker push ${{ env.WINDOWS_STABLE_GHCR }}
233+
234+
promote-linux:
235+
needs: [windows-tests, linux-tests]
236+
runs-on: ubuntu-latest
237+
if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }}
238+
env:
239+
LINUX_UNSTABLE: ghcr.io/ansys/geometry:linux-latest-unstable
240+
LINUX_STABLE_GHCR: ghcr.io/ansys/geometry:linux-latest
241+
steps:
242+
- name: Login in Github Container registry
243+
uses: docker/login-action@v3
244+
with:
245+
registry: ghcr.io
246+
username: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
247+
password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
248+
249+
- name: Pull Linux latest unstable container
250+
run: docker pull ${{ env.LINUX_UNSTABLE }}
251+
252+
- name: Tag container as latest (stable) for Github Container registry
253+
run: docker tag ${{ env.LINUX_UNSTABLE }} ${{ env.LINUX_STABLE_GHCR }}
254+
255+
- name: Publish latest stable container in ghcr.io
256+
run: docker push ${{ env.LINUX_STABLE_GHCR }}

0 commit comments

Comments
 (0)