Skip to content

Commit 8aaad5a

Browse files
authored
Build docs and push to gh-pages (#56)
* build docs and push to gh-pages test * try creating folder ahead of time and setting write permissions * try running container as root user * don't use PWD * move changes to main deploy workflow
1 parent ca649ea commit 8aaad5a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: Run tests
2020
run: docker run --user=allagash -v $PWD/tests:/home/allagash/tests -v $PWD/src-doc:/home/allagash/src-doc apulverizer/allagash:build /bin/bash -c "py.test --nbval"
2121
- name: Build documentation
22-
run: docker run --user=allagash -v $PWD/src-doc:/home/allagash/src-doc apulverizer/allagash:build /bin/bash -c "sphinx-build -b html ./src-doc ./doc -a"
22+
run: docker run --user=root -v $PWD/doc:/home/allagash/doc -v $PWD/src-doc:/home/allagash/src-doc apulverizer/allagash:build /bin/bash -c "sphinx-build -b html ./src-doc ./doc -a"

.github/workflows/deploy.yml

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [published]
66

7+
permissions:
8+
contents: write
9+
710
jobs:
811
deploy:
912
runs-on: ubuntu-latest
@@ -23,6 +26,16 @@ jobs:
2326
run: docker run --user=allagash -w /home/allagash/src apulverizer/allagash:build
2427
/bin/bash -c "twine upload -u __token__ -p $PYPI_API_TOKEN dist/*"
2528

29+
- name: Build docs
30+
# Run as root so results can be saved to GHA runner host
31+
run: docker run --user=root -v $PWD/doc:/home/allagash/doc -v $PWD/src-doc:/home/allagash/src-doc apulverizer/allagash:build /bin/bash -c "sphinx-build -b html ./src-doc ./doc -a"
32+
33+
- name: Deploy docs
34+
uses: JamesIves/github-pages-deploy-action@v4
35+
with:
36+
folder: doc
37+
branch: gh-pages
38+
2639
- name: Build public docker image
2740
run: VERSION=$(docker run --user=allagash apulverizer/allagash:build /bin/bash -c "python -c 'import allagash;print(allagash.__version__)'")
2841
&& docker build --build-arg VERSION=$VERSION . -t apulverizer/allagash:latest -t apulverizer/allagash:$VERSION

0 commit comments

Comments
 (0)