update readme #169
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: docs | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- name: Checkout github repo | |
uses: actions/checkout@v2 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Install pandoc | |
run: sudo apt-get install pandoc | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "poetry" | |
- name: Install FFTW | |
run: | | |
sudo apt-get install libfftw3-dev | |
- name: Install python packages | |
run: | | |
poetry install | |
- name: build docs | |
shell: bash -l {0} | |
run: | | |
cd docs | |
poetry run make html | |
if [ $? = 2 ]; then exit 1;fi | |
cd build/html | |
touch .nojekyll | |
- name: Commit documentation changes | |
run: | | |
git clone https://github.com/LSSTDESC/BlendingToolKit.git --branch gh-pages --single-branch gh-pages | |
cp -r docs/build/html/* gh-pages/docs/ | |
cd gh-pages/docs | |
touch .nojekyll | |
git config --local user.email "action@github.com" | |
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 | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} |