Skip to content

Commit

Permalink
[docs] Github Actions workflow to facilitate docs deployment (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
francoishernandez authored Jul 1, 2024
1 parent aa6d387 commit aa72f5d
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 48 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy Docs

# Trigger manually via Github Actions UI for now, on release later
on: ["workflow_dispatch", "workflow_call"]

jobs:
build_and_deploy_docs:
runs-on: ubuntu-22.04
permissions: write-all
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20
- name: Install Eole
run: pip install -e .
- name: Install pandoc (bibtex to markdown)
run: |
wget https://github.com/jgm/pandoc/releases/download/3.2.1/pandoc-3.2.1-1-amd64.deb;
sudo dpkg -i pandoc-3.2.1-1-amd64.deb
- name: Install docusaurus and deps
run: |
cd docs/docusaurus_tsx && npm install
- name: Build docs
run: |
cd docs && pip install -r requirements.txt && ./build_docs.sh
- name: Deploy to Github Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/docusaurus_tsx/build
branch: gh-pages-docs
clean: true
token: ${{ secrets.GITHUB_TOKEN }}
71 changes: 23 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,26 @@ on:

jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools
pip install -e .
pip install -r docs/requirements.txt
pip install -r requirements.opt.txt
pip install rich
- name: Build docs
run: |
set -e
# Check that docs are built without errors
cd docs/ && make html && cd ..
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build/html
CLEAN: true
publish-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel
- name: Build a binary wheel and a source tarball
run: |
python setup.py sdist bdist_wheel
- name: Publish release to PyPi
uses: pypa/gh-action-pypi-publish@54b39fb9371c0b3a6f9f14bb8a67394defc7a806
with:
user: __token__
password: ${{ secrets.pypi_password }}
verbose: true
uses: ./.github/workflows/deploy_docs.yml
# TODO: enable PyPI release
# publish-pypi:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python 3.10
# uses: actions/setup-python@v2
# with:
# python-version: 3.10
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install --upgrade setuptools wheel
# - name: Build a binary wheel and a source tarball
# run: |
# python setup.py sdist bdist_wheel
# - name: Publish release to PyPi
# uses: pypa/gh-action-pypi-publish@54b39fb9371c0b3a6f9f14bb8a67394defc7a806
# with:
# user: __token__
# password: ${{ secrets.pypi_password }}
# verbose: true

0 comments on commit aa72f5d

Please sign in to comment.