-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66b8ea2
commit 97c4df5
Showing
4 changed files
with
59 additions
and
46 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
tags: ["*"] | ||
pull_request: | ||
# Check all PR | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: setup rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
- name: setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: install dependencies | ||
run: | | ||
python -m pip install tox | ||
- name: build documentation | ||
run: tox -e docs | ||
|
||
- name: put documentation in the website | ||
run: | | ||
git clone https://github.com/$GITHUB_REPOSITORY --branch gh-pages gh-pages | ||
rm -rf gh-pages/.git | ||
cd gh-pages | ||
REF_KIND=$(echo $GITHUB_REF | cut -d / -f2) | ||
if [[ "$REF_KIND" == "tags" ]]; then | ||
TAG=${GITHUB_REF#refs/tags/} | ||
mv ../docs/build/html $TAG | ||
else | ||
rm -rf latest | ||
mv ../docs/build/html latest | ||
fi | ||
- name: deploy to gh-pages | ||
if: github.event_name == 'push' | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./gh-pages/ | ||
force_orphan: true | ||
|
||
- if: github.event_name == 'pull_request' | ||
name: Post link to RTD | ||
uses: readthedocs/actions/preview@v1 | ||
with: | ||
project-slug: "software-cookbook" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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