Skip to content

Commit

Permalink
feat: breakup AnsysLab deployment (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobPasMue authored Jan 2, 2024
1 parent f46747c commit 494a5ed
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 57 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docker_ansyslab_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Upload Linux latest to Ansys Lab

on:
workflow_dispatch:
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
packages: read

env:
LINUX_STABLE_GHCR: ghcr.io/ansys/geometry:linux-latest
LINUX_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:linux-latest

jobs:
linux-ansyslab:
name: Publish Linux latest image on AnsysLab
runs-on:
group: ansys-network
labels: [Linux, pygeometry]
steps:
- name: Login in Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Linux latest stable container
run: docker pull ${{ env.LINUX_STABLE_GHCR }}

- name: Login in AnsysLab registry
uses: docker/login-action@v3
with:
registry: azwepsifujiaksacr.azurecr.io
username: ${{ secrets.FUJI_USER }}
password: ${{ secrets.FUJI_TOKEN }}

- name: Tag container as latest (stable) for AnsysLab registry
run: docker tag ${{ env.LINUX_STABLE_GHCR }} ${{ env.LINUX_STABLE_FUJI }}

- name: Publish latest stable container in AnsysLab registry
run: docker push ${{ env.LINUX_STABLE_FUJI }}

- name: Remove images (free space)
run: docker image rm ${{ env.LINUX_STABLE_FUJI }} ${{ env.LINUX_STABLE_GHCR }}
46 changes: 46 additions & 0 deletions .github/workflows/docker_ansyslab_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Upload Windows latest to Ansys Lab

on:
workflow_dispatch:
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
packages: read

env:
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:windows-latest

jobs:
windows-ansyslab:
name: Publish Windows latest image on AnsysLab
runs-on:
group: ansys-network
labels: [Windows, pygeometry]
steps:
- name: Login in Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Windows latest unstable container
run: docker pull ${{ env.WINDOWS_STABLE_GHCR }}

- name: Login in AnsysLab registry
uses: docker/login-action@v3
with:
registry: azwepsifujiaksacr.azurecr.io
username: ${{ secrets.FUJI_USER }}
password: ${{ secrets.FUJI_TOKEN }}

- name: Tag container as latest (stable) for AnsysLab registry
run: docker tag ${{ env.WINDOWS_STABLE_GHCR }} ${{ env.WINDOWS_STABLE_FUJI }}

- name: Publish latest stable container in AnsysLab registry
run: docker push ${{ env.WINDOWS_STABLE_FUJI }}
61 changes: 4 additions & 57 deletions .github/workflows/docker_push_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ permissions:
env:
WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:windows-latest-unstable
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:windows-latest
LINUX_UNSTABLE: ghcr.io/ansys/geometry:linux-latest-unstable
LINUX_STABLE_GHCR: ghcr.io/ansys/geometry:linux-latest
LINUX_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:linux-latest

jobs:
windows:
Expand Down Expand Up @@ -57,32 +55,8 @@ jobs:
name: Publish Windows latest image on AnsysLab
if: inputs.ansyslab
needs: [windows]
runs-on:
group: ansys-network
labels: [Windows, pygeometry]
steps:
- name: Login in Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Windows latest unstable container
run: docker pull ${{ env.WINDOWS_STABLE_GHCR }}

- name: Login in AnsysLab registry
uses: docker/login-action@v3
with:
registry: azwepsifujiaksacr.azurecr.io
username: ${{ secrets.FUJI_USER }}
password: ${{ secrets.FUJI_TOKEN }}

- name: Tag container as latest (stable) for AnsysLab registry
run: docker tag ${{ env.WINDOWS_STABLE_GHCR }} ${{ env.WINDOWS_STABLE_FUJI }}

- name: Publish latest stable container in AnsysLab registry
run: docker push ${{ env.WINDOWS_STABLE_FUJI }}
uses: ./.github/workflows/docker_ansyslab_windows.yml
secrets: inherit

linux:
name: Publish Linux latest image
Expand All @@ -109,32 +83,5 @@ jobs:
name: Publish Linux latest image on AnsysLab
if: inputs.ansyslab
needs: [linux]
runs-on:
group: ansys-network
labels: [Linux, pygeometry]
steps:
- name: Login in Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Linux latest stable container
run: docker pull ${{ env.LINUX_STABLE_GHCR }}

- name: Login in AnsysLab registry
uses: docker/login-action@v3
with:
registry: azwepsifujiaksacr.azurecr.io
username: ${{ secrets.FUJI_USER }}
password: ${{ secrets.FUJI_TOKEN }}

- name: Tag container as latest (stable) for AnsysLab registry
run: docker tag ${{ env.LINUX_STABLE_GHCR }} ${{ env.LINUX_STABLE_FUJI }}

- name: Publish latest stable container in AnsysLab registry
run: docker push ${{ env.LINUX_STABLE_FUJI }}

- name: Remove images (free space)
run: docker image rm ${{ env.LINUX_STABLE_FUJI }} ${{ env.LINUX_STABLE_GHCR }}
uses: ./.github/workflows/docker_ansyslab_linux.yml
secrets: inherit

0 comments on commit 494a5ed

Please sign in to comment.