Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
datadavev committed Nov 24, 2020
2 parents 4cff0b0 + 6b4d87c commit 916497b
Show file tree
Hide file tree
Showing 8 changed files with 757 additions and 30 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build Pages

on:
push:
branches:
- master

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install Poetry
run: |
sudo apt install pandoc
pip install setuptools
pip install poetry
shell: bash

- name: Cache Poetry virtualenv
uses: actions/cache@v2
id: cache
with:
path: ~/.poetry/venv
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Configure poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project false
poetry config cache-dir ~/.poetry
poetry config virtualenvs.path ~/.poetry/venv
pip3 install setuptools
- name: Install dependencies
run: |
export SETUPTOOLS_USE_DISTUTILS=stdlib
poetry install
if: steps.cache.outputs.cache-hit != 'true'

- name: Build documentation
run: |
poetry run sphinx-build -M html source build
- name: Commit documentation changes
run: |
git clone https://github.com/DataONEorg/api-documentation.git --branch gh-pages --single-branch gh-pages
cd gh-pages
find . -not -path '*/\.*' -delete
cp -r ../build/html/* .
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
# the return code.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 916497b

Please sign in to comment.