From 262bc1d486b79710bb51f55b03f5f45eb867eabf Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Mon, 19 Aug 2024 13:19:13 +1000 Subject: [PATCH 1/4] Release environment: Add xarray and mule dependencies --- env.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/env.yml b/env.yml index 4ff20e0..e1e7a6b 100644 --- a/env.yml +++ b/env.yml @@ -16,3 +16,5 @@ dependencies: - nco - pytest - openssh>=8.3 + - xarray + - mule From f5e4f41f444f0d4ac3961be7e4ef359e4f98958f Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Mon, 19 Aug 2024 13:21:42 +1000 Subject: [PATCH 2/4] deploy workflow: Update upload/down artifact to version 4 --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c9566c9..e0f518d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -50,7 +50,7 @@ jobs: conda-lock lock --file env.yml --platform linux-64 --micromamba --lockfile ${{ steps.payu.outputs.name }}.conda-lock.yml - name: Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ steps.payu.outputs.name }} if-no-files-found: error @@ -74,7 +74,7 @@ jobs: permissions: contents: write steps: - - uses: actions/download-artifact@v3.0.2 + - uses: actions/download-artifact@v4 with: name: ${{ env.NAME }} From c36f519d240d4bff6d795f013b65f78d270082ee Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Mon, 19 Aug 2024 14:31:58 +1000 Subject: [PATCH 3/4] Deploy workflow: Remove environment if it is pre-existing --- .github/workflows/deploy.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e0f518d..79998b1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -99,14 +99,17 @@ jobs: ssh ${{ secrets.USER }}@${{ secrets.HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT' mkdir ${{ env.PAYU_ENVIRONMENT_LOCATION }} if [ $? -ne 0 ]; then - exit $? + # Replace pre-existing environment + echo "Removing pre-existing environment at: ${{ env.PAYU_ENVIRONMENT_LOCATION }}" + rm -rf "${{ env.PAYU_ENVIRONMENT_LOCATION }}" + mkdir ${{ env.PAYU_ENVIRONMENT_LOCATION }} fi tar -xzf ${{ vars.PACK_LOCATION }}/${{ env.NAME }}.tar.gz -C ${{ env.PAYU_ENVIRONMENT_LOCATION }} source ${{ env.PAYU_ENVIRONMENT_LOCATION }}/bin/activate conda-unpack payu --version source ${{ env.PAYU_ENVIRONMENT_LOCATION }}/bin/deactivate - ln -s ${{ vars.MODULE_LOCATION }}/.common ${{ vars.MODULE_LOCATION }}/${{ env.VERSION }} + ln -sf ${{ vars.MODULE_LOCATION }}/.common ${{ vars.MODULE_LOCATION }}/${{ env.VERSION }} EOT # Release From cc6083b4bc779eff59df05031baf11f0ee8d76f7 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 20 Aug 2024 13:12:42 +1000 Subject: [PATCH 4/4] Deploy workflow: Using ::warning:: for pre-existing environments --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 79998b1..6349824 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -100,7 +100,7 @@ jobs: mkdir ${{ env.PAYU_ENVIRONMENT_LOCATION }} if [ $? -ne 0 ]; then # Replace pre-existing environment - echo "Removing pre-existing environment at: ${{ env.PAYU_ENVIRONMENT_LOCATION }}" + echo "::warning::Removing pre-existing environment at: ${{ env.PAYU_ENVIRONMENT_LOCATION }}" rm -rf "${{ env.PAYU_ENVIRONMENT_LOCATION }}" mkdir ${{ env.PAYU_ENVIRONMENT_LOCATION }} fi