Documentation Build by PrinceWalnut #106
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 | |
run-name: Documentation Build by ${{ github.actor }} | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: [ubuntu-latest] | |
if: "!contains(github.event.head_commit.message, 'skip docs')" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
channels: conda-forge, defaults | |
auto-activate-base: true | |
activate-environment: "" | |
- name: Source Miniconda | |
run: | | |
source $CONDA/etc/profile.d/conda.sh | |
conda activate | |
which python | |
python --version | |
echo $CONDA | |
conda install -n base conda-libmamba-solver | |
conda config --set solver libmamba | |
python -m pip install --upgrade pip | |
- name: Install DIALS environment and more | |
run: | | |
source $CONDA/etc/profile.d/conda.sh | |
conda activate | |
conda install -n base -c conda-forge -y dials pandoc | |
conda info | |
conda list | |
pip install -e ".[docs]" | |
cd docs | |
export SPHINXBUILD="$CONDA/bin/sphinx-build" | |
make clean | |
make html | |
- name: Commit documentation changes to gh-pages | |
run: | | |
cd docs | |
git clone https://github.com/rs-station/laue-dials.git --branch gh-pages --single-branch gh-pages | |
cd gh-pages | |
cp -r ../_build/html/* . | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
touch .nojekyll | |
git add .nojekyll | |
git diff --quiet && git diff --staged --quiet || git commit -m "Upload documentation from latest commit" | |
- name: Push changes to gh-pages | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: "gh-pages" | |
directory: "docs/gh-pages" |