Skip to content

Merge pull request #1 from GT4SD/main (#251) #298

Merge pull request #1 from GT4SD/main (#251)

Merge pull request #1 from GT4SD/main (#251) #298

Workflow file for this run

name: "Build docs with Sphinx"
on:
push:
branches:
- main
- ci-setup
jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
shell: bash -l {0} # for conda command
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: gt4sd
environment-file: conda_cpu_linux.yml
auto-activate-base: false
use-only-tar-bz2: true
- name: Build docs
run: |
conda activate gt4sd
pip install --no-deps .
# make sure we can build docs using specific dependencies
pip install "attrs==20.3.0" "markdown-it-py==1.0.0"
cd docs && make html && cd ..
- name: Commit documentation changes
run: |
git clone https://github.com/GT4SD/gt4sd-core.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
touch gh-pages/.nojekyll
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "docs: update documentation." -a || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}