Gamma surface & stacking fault tools #63
Workflow file for this run
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: Build and publish documentation | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: install_python | |
run: | | |
sudo apt-get update -qy | |
sudo apt-get install -y python3-dev python3-pip libxml2-dev libxslt-dev zlib1g-dev | |
# Upgrade to latest meson and ninja | |
sudo pip install --upgrade meson ninja | |
- name: install_package | |
run: | | |
sudo pip install .[docs] | |
# Standard drop-in approach that should work for most people. | |
- name: build_doc | |
run: | | |
cd docs | |
make html | |
cd .. | |
# Publish built docs to gh-pages branch. | |
# =============================== | |
- name: Commit documentation changes | |
run: | | |
git clone https://github.com/libAtoms/matscipy.git --branch gh-pages --single-branch gh-pages | |
cp -r docs/_build/html/* gh-pages/ | |
cd gh-pages | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update documentation" -a || true | |
# The above command will fail if no changes were present, so we ignore | |
# that. | |
- name: Push changes | |
if: github.ref == 'refs/heads/master' | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} |