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
name: Deploy to GitHub Pages | |
# https://jaimestill.github.io/docusaur-gh/config | |
defaults: | |
run: | |
working-directory: docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'docs/**' | |
- '.github/workflows/deploy-githubpages.yml' | |
- 'sunholo/**' | |
- 'setup.py' | |
- 'build_scripts/export_docstrings.py' | |
# Allow manual trigger | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build Docusaurus | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: yarn | |
cache-dependency-path: docs/yarn.lock | |
- name: Install dependencies | |
run: yarn install | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Export Docstrings | |
run: pip install --upgrade pip && pip install setuptools && pip install -e .[all] && python build_scripts/export_docstrings.py | |
working-directory: ${{ github.workspace }} | |
# Expose environment variable for the API key (via GitHub Secrets) | |
- name: Set environment variable | |
run: echo "REACT_APP_MULTIVAC_API_KEY=${{ secrets.MULTIVAC_API_KEY }}" >> $GITHUB_ENV | |
- name: Build website | |
run: yarn build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/build | |
user_name: github-actions[bot] | |
user_email: 41898282+github-actions[bot]@users.noreply.github.com |