diff --git a/.github/workflows/demos_ltr_latest.yml b/.github/workflows/demos_ltr_latest.yml index 695c95e5c6c0..28b786b53e2f 100644 --- a/.github/workflows/demos_ltr_latest.yml +++ b/.github/workflows/demos_ltr_latest.yml @@ -5,12 +5,11 @@ on: inputs: git-ref: description: Git Ref - default: engine-3.16 # FIXME: point to ltr + default: engine-3.16 # TODO: point to ltr required: true push: - # FIXME: it would be better to point to ltr and latest - # branches: [ demos_ltr_latest, engine-3.16, engine-3.17, engine-3.18 ] - branches: [ demos_ltr_latest ] + # TODO: it would be better to point to ltr and latest + branches: [ engine-3.16, engine-3.17, engine-3.18, engine-3.19] jobs: demos: runs-on: ubuntu-latest @@ -30,7 +29,7 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.git-ref }} - - name: Set up Python 3.10 + - name: Set up Python 3.10 # for compatibility with engine 3.16 uses: actions/setup-python@v5 with: python-version: "3.10" @@ -40,21 +39,18 @@ jobs: pip install --default-timeout=100 -U pip pip install pydata-sphinx-theme - name: Install OpenQuake engine - # env: - # GITHUB_DEF_BR: ${{ github.event.repository.default_branch }} - # GITHUB_REF: ${{ github.ref }} run: | - if [ -z "$GITHUB_INPUT_REF" ] + if ${{ github.event_name == 'pull_request' }} then - echo " Is not a workflow_dispatch RUN, use: $GITHUB_DEF_BR " - python install.py devel --version ${GITHUB_DEF_BR} + echo "It is a pull request; use the corresponding branch: ${GITHUB_HD_REF}" + python install.py devel --version ${GITHUB_HD_REF} else - echo " Is a workflow_dispatch RUN, use: $GITHUB_INPUT_REF " - GITHUB_BR=`echo ${{ github.head_ref }}` + echo "It was triggered manually; use the selected Git Ref: $GITHUB_INPUT_REF " python install.py devel --version ${GITHUB_INPUT_REF} fi - - name: Run demos and upload to ci.openquake.org if not workflow_dispatch - if: github.event.inputs.git-ref == '' + - name: Run demos and upload to ci.openquake.org + # uncomment the line below to avoid running this part when triggering the action manually + # if: github.event.inputs.git-ref == '' shell: bash env: DOCS_SSH: ${{ secrets.DOCS_ARTIFACTS }} @@ -70,14 +66,13 @@ jobs: oq dump /tmp/oqdata.zip oq restore /tmp/oqdata.zip /tmp/oqdata helpers/zipdemos.sh $(pwd)/demos - echo " Check if this is a pull request or not" - if [ -z "$GITHUB_HD_REF" ] + if ${{ github.event_name == 'pull_request' }} then - echo " Is not a pull request, use branch: $GITHUB_DEF_BR" - GITHUB_BR=`echo ${{ github.event.repository.default_branch }}` + echo "It is a pull request; use the corresponding branch: ${GITHUB_HD_REF}" + GITHUB_BR=${GITHUB_HD_REF} else - echo " Is a pull request, use branch: $GITHUB_HD_BR" - GITHUB_BR=`echo ${{ github.head_ref }}` + echo "It was triggered manually; use the selected Git Ref: $GITHUB_INPUT_REF " + GITHUB_BR=${GITHUB_INPUT_REF} fi echo "BRANCH set to $GITHUB_BR" gpg --quiet --batch --yes --decrypt --passphrase="$DOCS_SSH" --output ./.deploy_rsa ./.deploy_docs.enc