diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml new file mode 100644 index 0000000..447e383 --- /dev/null +++ b/.github/workflows/sphinx.yml @@ -0,0 +1,41 @@ +name: Build documentation + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: write + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: mamba-org/setup-micromamba@v1 + with: + micromamba-version: '1.5.8-0' # any version from https://github.com/mamba-org/micromamba-releases + environment-file: environment.yml + init-shell: bash + cache-environment: true + post-cleanup: 'all' + generate-run-shell: false + + - name: Sphinx build + run: | + sphinx-build doc _build + shell: bash -el {0} + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + 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 \ No newline at end of file diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..1abb1a6 --- /dev/null +++ b/environment.yml @@ -0,0 +1,9 @@ +name: pybalmorel +channels: + - conda-forge +dependencies: + - python=3.9 + - myst-parser + - sphinx + - sphinx-rtd-theme + - sphinx-autoapi \ No newline at end of file