-
Notifications
You must be signed in to change notification settings - Fork 12
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
Showing
3 changed files
with
87 additions
and
54 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,43 @@ | ||
name: Build and Test Documentation | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build and Test | ||
runs-on: ubuntu-22.04 | ||
environment: Testing | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10.12" | ||
|
||
- name: Install pipenv and dependencies | ||
run: | | ||
python -m pip install --upgrade pipenv wheel | ||
pipenv install --deploy --dev | ||
- name: Build HTML pages | ||
id: make_html | ||
run: | | ||
pipenv run make html SPHINXOPTS="-W --keep-going" # -W: Fail on warnings. --keep-going: Continue processing on warnings, but fail at the end | ||
- name: Check all external links | ||
id: make_linkcheck | ||
run: | | ||
pipenv run make linkcheck SPHINXOPTS="-W --keep-going -n" # -n: nit-picky mode, generates warnings for all missing references | ||
- name: Upload docs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: html | ||
if-no-files-found: error | ||
path: docs/html/* |
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,44 @@ | ||
name: Deploy Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-22.04 | ||
environment: Production | ||
|
||
steps: | ||
- name: Download html artifact | ||
run: | | ||
repo="${{ github.repository }}" | ||
workflow="build_and_test.yml" | ||
artifact="html" | ||
run_id=`gh run --repo ${repo} list --workflow ${workflow} --json databaseId --jq .[0].databaseId` | ||
mkdir html | ||
cd html | ||
gh run --repo ${repo} download ${run_id} -n ${artifact} | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Commit documentation changes | ||
run: | | ||
git clone https://github.com/${{ github.repository_owner }}/miniscope-docs.git --branch gh-pages --single-branch gh-pages | ||
cd gh-pages | ||
rm -rf * | ||
cp -r ../html/* . | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Update documentation" -a || true | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: gh-pages | ||
directory: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.