Merge remote-tracking branch 'refs/remotes/origin/main' #42
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
# this combines web pages from two sources. The prebuilt web pages | |
# with tutorials and the web pages output from SphinxDocs with | |
# installation & build info etc. | |
# | |
# TODO: add run of scripts/makeGitTutorial here. Requires access to | |
# GSASII source code (via import of GSASIIctrlGUI or could pull TutorialIndex | |
# out for direct import here) | |
# | |
name: build web documentation | |
#on: [push, pull_request, workflow_dispatch] | |
on: [push, workflow_dispatch] # why build on pull request? | |
permissions: | |
contents: write | |
id-token: write | |
pages: write | |
jobs: | |
build: # Build web pages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Sphinx setup | |
uses: actions/setup-python@v3 | |
- name: Install dependencies | |
run: | | |
pip install sphinx sphinx_rtd_theme sphinxnotes.strike | |
- name: Sphinx build | |
run: | | |
sphinx-build webdocs . # place output into root dir | |
# get the help pages from the GSAS-II sources into the web site | |
- name: Get GSAS-II | |
run: | | |
git clone --depth 1 https://github.com/AdvancedPhotonSource/GSAS-II.git _gsas2 | |
- name: move help into site | |
run: | | |
mv _gsas2/GSASII/help ./help | |
- name: Get rid of the rest of the GSAS-II files | |
run: | | |
rm -rf _gsas2 | |
- name: Upload artifact # creates zip file with website contents | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: . | |
name: github-pages | |
retention-days: 1 | |
deploy: # Deployment of web pages to GitHub pages | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifact_name: github-pages |