-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from naik-aakash/doc_deployment_wf
Add docs deployment to ci
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 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,48 @@ | ||
name: build-docs | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
release: | ||
types: [ published ] | ||
|
||
# set GITHUB_TOKEN permissions to allow deployment to GitHub Pages | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
- name: Set up micromamba | ||
uses: mamba-org/setup-micromamba@main | ||
- name: Create mamba environment | ||
run: | | ||
micromamba create -n autoplex_docs python=$PYTHON_VERSION --yes | ||
- name: Install uv | ||
run: micromamba run -n autoplex_docs pip install uv | ||
- name: Install autoplex and dependencies | ||
run: | | ||
micromamba activate autoplex_docs | ||
uv pip install --upgrade pip | ||
uv pip install .[docs,strict] | ||
- name: Build | ||
run: micromamba run -n autoplex_docs sphinx-build -W docs _build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
with: | ||
publish_branch: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: _build/ | ||
force_orphan: true |