diff --git a/.github/workflows/docker_ansyslab_linux.yml b/.github/workflows/docker_ansyslab_linux.yml new file mode 100644 index 0000000000..6667752c3a --- /dev/null +++ b/.github/workflows/docker_ansyslab_linux.yml @@ -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 }} diff --git a/.github/workflows/docker_ansyslab_windows.yml b/.github/workflows/docker_ansyslab_windows.yml new file mode 100644 index 0000000000..cdcdf42ff5 --- /dev/null +++ b/.github/workflows/docker_ansyslab_windows.yml @@ -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 }} diff --git a/.github/workflows/docker_push_stable.yml b/.github/workflows/docker_push_stable.yml index 96a5a69cc1..8169b52326 100644 --- a/.github/workflows/docker_push_stable.yml +++ b/.github/workflows/docker_push_stable.yml @@ -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: @@ -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 @@ -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