-
Notifications
You must be signed in to change notification settings - Fork 0
Fix docs release workflow #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,56 +2,60 @@ name: Deploy docs | |
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| package: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make sense to use a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We had a list before, so I think it would be ok to have a choice here? especially if it translates to a dropdown menu in the web ui? |
||
| required: true | ||
| description: 'Select which package to build docs for' | ||
| type: choice | ||
| options: | ||
| - essreduce | ||
| - essimaging | ||
| - essnmx | ||
| publish: | ||
| default: false | ||
| type: boolean | ||
| branch: | ||
| description: 'Branch/tag with documentation source. If not set, the main branch will be used.' | ||
| default: 'main' | ||
| required: false | ||
| type: string | ||
|
|
||
| jobs: | ||
| docs: | ||
| name: Build and deploy docs | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: write | ||
| strategy: | ||
| matrix: | ||
| package: [essreduce, essimaging, essnmx] | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ inputs.branch }} | ||
| fetch-depth: 0 | ||
| - uses: prefix-dev/setup-pixi@v0.9.4 | ||
| with: | ||
| frozen: true | ||
| environments: docs-${{ matrix.package }} | ||
| environments: docs-${{ inputs.package }} | ||
| - name: Build docs | ||
| run: pixi run -e docs-${{ matrix.package }} docs ${{ matrix.package }} | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: docs-${{ matrix.package }} | ||
| path: packages/${{ matrix.package }}/html | ||
|
|
||
| deploy: | ||
| name: Deploy site | ||
| needs: docs | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| path: site | ||
| pattern: docs-* | ||
| merge-multiple: false | ||
| run: pixi run docs-${{ inputs.package }}}} | ||
| - name: Prepare site | ||
| if: ${{ inputs.publish }} | ||
| run: | | ||
| mkdir -p gh-pages-site | ||
| for dir in site/docs-*; do | ||
| package="${dir#site/docs-}" | ||
| cp -r "$dir" "gh-pages-site/$package" | ||
| done | ||
| PACKAGE=${{ inputs.package }} | ||
| git fetch origin gh-pages:gh-pages || true | ||
| git worktree add gh-pages-site gh-pages || mkdir -p gh-pages-site | ||
| rm -rf gh-pages-site/$PACKAGE | ||
| cp -r packages/$PACKAGE/html gh-pages-site/$PACKAGE | ||
| cp docs/index.html gh-pages-site/index.html | ||
| touch gh-pages-site/.nojekyll | ||
| - name: Build search index | ||
| if: ${{ inputs.publish }} | ||
| run: npx pagefind@latest --site gh-pages-site --bundle-dir pagefind | ||
| - uses: JamesIves/github-pages-deploy-action@v4 | ||
| if: ${{ inputs.publish }} | ||
| with: | ||
| branch: gh-pages | ||
| folder: gh-pages-site | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: docs-${{ inputs.package }} | ||
| path: packages/${{ inputs.package }}/html | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have 3 workflows that build docs, 2 of them also publish the docs to different places. Can we merge these into a reusable workflow and call that from CI, releases, and the web UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I felt when I was trying to fix this.
But I felt it would be complicated to get right first time, and I did not want this to block releases for the other packages.
So we can fix as a follow-up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Can you open an issue?