From c36f1d0048ca1bb31b21e3fe9193a35cbde27859 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Mon, 17 Jun 2024 09:30:40 +1000 Subject: [PATCH] Update deploy-dev.yml: Add in review suggestions --- .github/workflows/deploy-dev.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index 565e0b7..e840ce7 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -24,11 +24,7 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | # Fetch the last successful workflow run time - response=$(gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/access-nri/payu-condaenv/actions/workflows/deploy-dev.yml/runs?status=success&per_page=1) - last_run_time=$(echo $response | jq -r '.workflow_runs[0].updated_at') + last_run_time=$(gh run list --status success --workflow deploy-dev.yml --json updatedAt --jq .[0].updatedAt) echo "Last successful workflow run time: $last_run_time" echo "last-run-time=$last_run_time" >> $GITHUB_OUTPUT @@ -141,16 +137,13 @@ jobs: old_versions=$(ls "${{ vars.PRERELEASE_DEPLOYMENT_LOCATION }}" | grep -E '^dev-[0-9]{8}T[0-9]{6}Z-.*') # Unpack conda enviroment - mkdir ${{ env.ENVIRONMENT_LOCATION }} - if [ $? -ne 0 ]; then - exit $? - fi + mkdir ${{ env.ENVIRONMENT_LOCATION }} || exit $? tar -xzf ${{ env.PACKED_ENVIRONMENT }} -C ${{ env.ENVIRONMENT_LOCATION }} source ${{ env.ENVIRONMENT_LOCATION }}/bin/activate conda-unpack payu --version source ${{ env.ENVIRONMENT_LOCATION }}/bin/deactivate - echo "New payu/dev environment unpacked to ${{ env.ENVIRONMENT_LOCATION }}" + echo "::notice::New payu/dev environment unpacked to ${{ env.ENVIRONMENT_LOCATION }}" # Check if payu/dev symlink already exists if [ -L "${{ env.ENVIRONMENT_SYMLINK}}" ]; then