mirror of https://github.com/inclusionAI/AReaL
add doc ci (#54)
This commit is contained in:
parent
7826fdbb87
commit
d13b517cbf
|
@ -0,0 +1,57 @@
|
|||
name: Deploy Jupyter Book to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ] # Change to your default branch if different
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
# Allow one concurrent deployment
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: true
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9' # Adjust version as needed
|
||||
|
||||
- name: Cache pip dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install jupyter-book ghp-import
|
||||
# Install additional dependencies if you have a requirements.txt
|
||||
# pip install -r requirements.txt
|
||||
|
||||
- name: Build the book
|
||||
run: |
|
||||
jupyter-book build docs
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
if: github.ref == 'refs/heads/main' # Only deploy on main branch
|
||||
run: |
|
||||
ghp-import -n -p -f docs/_build/html
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in New Issue