Skip to content

Commit

Permalink
docs: test deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
SaaiVenkat committed May 15, 2024
1 parent d8c3a0c commit 512ea3f
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build and Deploy API docs and GitHub Pages

on:
push:
branches:
- main
- ci/setup-semantic-release

jobs:
build-docs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
uses: actions/cache@v2
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry lock --no-update
poetry install
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Run quartodoc
run: |
cd docs
poetry run quartodoc build --verbose
- name: Build site
# if: ${{ github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'ci') }}
run: |
cd docs
poetry run quarto render
- name: Upload site artifact
# if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v1
with:
path: docs/_site

deploy:
if: github.ref == 'refs/heads/ci/setup-semantic-release' # TODO: Undo this
needs: build-docs

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site

0 comments on commit 512ea3f

Please sign in to comment.