Skip to content

Commit

Permalink
ci(rtd): fix artifact upload sha, update concurrency key, cleanup (#2258
Browse files Browse the repository at this point in the history
)

The RTD build integration expects artifacts named according to the pattern prefix-sha. Previously the workflow used the current ref's hash, not the hash of the selected ref. Fix it so the RTD build can find the proper artifacts. Also add the workflow trigger to the concurrency group key.
  • Loading branch information
wpbonelli authored Jul 4, 2024
1 parent 3c6496b commit 278efbf
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/rtd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ on:
type: string
default: 'refs/heads/develop'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
set_options:
name: Set release options
if: github.ref_name != 'master'
runs-on: ubuntu-22.04
outputs:
ref: ${{ steps.set_ref.outputs.ref }}
sha: ${{ steps.set_sha.outputs.sha }}
steps:
- name: Set ref
id: set_ref
Expand All @@ -36,6 +36,15 @@ jobs:
echo "using current ref $ref"
fi
echo "ref=$ref" >> $GITHUB_OUTPUT
- name: Set sha
id: set_sha
run: |
if [[ ("${{ github.event_name }}" == "workflow_dispatch") && (-n "${{ inputs.ref }}") ]]; then
sha=$(git rev-parse ${{ steps.set_ref.outputs.ref }})
else
sha="${{ github.sha }}"
fi
echo "sha=$sha" >> $GITHUB_OUTPUT
rtd_build:
name: Prepare and test notebooks
needs: set_options
Expand Down Expand Up @@ -132,7 +141,7 @@ jobs:
)
uses: actions/upload-artifact@v4
with:
name: notebooks-for-${{ github.sha }}
name: notebooks-for-${{ needs.set_options.outputs.sha }}
path: .docs/Notebooks/*.ipynb

# trigger rtd if previous job was successful
Expand Down

0 comments on commit 278efbf

Please sign in to comment.