diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c9566c9..6349824 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 }} @@ -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 "::warning::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 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