Improve weight stack function #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation | |
on: [push, pull_request] | |
env: | |
DOC_SOURCE_PATH: docs | |
DOC_BUILD_PATH: docs/_build/html | |
DOC_ARTIFACT_NAME: doc_html | |
PAGES_BRANCH: nist-pages | |
jobs: | |
build-documentation: | |
name: Build docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout latest commit | |
uses: actions/checkout@v4 | |
- name: Set up CUDA and poetry | |
uses: ./.github/actions/install-with-poetry | |
with: | |
with-cuda: true | |
poetry-options: "--with=dev" | |
python-version: "3.11" # use 3.11 due to flaky pystackreg install on 3.12 | |
- name: Check links | |
run: | | |
cd ${{ env.DOC_SOURCE_PATH }} | |
poetry run make linkcheck | |
- name: Build docs | |
run: | | |
cd ${{ env.DOC_SOURCE_PATH }} | |
poetry run make html | |
- name: Upload built docs artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ env.DOC_BUILD_PATH }} | |
name: ${{ env.DOC_ARTIFACT_NAME }} | |
deploy-docs: | |
name: Deploy documentation | |
runs-on: ubuntu-latest | |
needs: build-documentation | |
if: ${{ (github.repository_owner == 'usnistgov' && github.ref_name == 'master') || github.repository_owner != 'usnistgov' }} | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout latest commit | |
uses: actions/checkout@v4 | |
- name: Commit to ${{ env.PAGES_BRANCH }} | |
uses: ./.github/actions/push-doc | |
with: | |
artifact_name: ${{ env.DOC_ARTIFACT_NAME }} | |
branch: ${{ env.PAGES_BRANCH }} | |
env: | |
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Push_dev: | |
# needs: Build | |
# # Push only on the "RELEASE_next_minor" and update the "dev" documentation | |
# if: ${{ github.repository_owner == 'hyperspy' && github.ref_name == 'RELEASE_next_minor' }} | |
# permissions: | |
# # needs write permission to push the docs to gh-pages | |
# contents: write | |
# # Use the "reusable workflow" from the hyperspy organisation | |
# uses: hyperspy/.github/.github/workflows/push_doc.yml@main | |
# with: | |
# repository: 'hyperspy/hyperspy-doc' | |
# output_path: 'dev' | |
# secrets: | |
# access_token: ${{ secrets.PAT_DOCUMENTATION }} | |
# Push_tag: | |
# needs: Build | |
# # Push only on tag and update the "current" documentation | |
# if: ${{ github.repository_owner == 'hyperspy' && startsWith(github.ref, 'refs/tags/') }} | |
# permissions: | |
# # needs write permission to push the docs to gh-pages | |
# contents: write | |
# # Use the "reusable workflow" from the hyperspy organisation | |
# uses: hyperspy/.github/.github/workflows/push_doc.yml@main | |
# with: | |
# repository: 'hyperspy/hyperspy-doc' | |
# output_path: 'current' | |
# secrets: | |
# access_token: ${{ secrets.PAT_DOCUMENTATION }} |