diff --git a/.github/workflows/docs.yml b/.github/workflows/docs_build_push.yml similarity index 97% rename from .github/workflows/docs.yml rename to .github/workflows/docs_build_push.yml index ef2d19420..78e82612d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs_build_push.yml @@ -1,4 +1,4 @@ -name: documentation +name: build and deploy docs to gh-pages on: workflow_call: diff --git a/.github/workflows/docs_build_test.yml b/.github/workflows/docs_build_test.yml new file mode 100644 index 000000000..dac5bf2a5 --- /dev/null +++ b/.github/workflows/docs_build_test.yml @@ -0,0 +1,40 @@ +name: test that docs build + +on: + workflow_call: + workflow_dispatch: + pull_request: + branches: + - main + +# This job installs dependencies, build the book, and pushes it to `gh-pages` +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install pandoc + run: sudo apt-get install pandoc + + # Install dependencies + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f packages/requirements.txt ]; then pip install -r packages/requirements.txt; fi + if [ -f packages/requirements-optional.txt ]; then pip install -r packages/requirements-optional.txt; fi + pip install -e packages/fairchem-core[docs,adsorbml] + pip install -e packages/fairchem-data-oc[dev] + pip install -e packages/fairchem-demo-ocpapi[dev] + pip install -e packages/fairchem-applications-cattsunami + + # Build the book + - name: Build the book + run: | + jupyter-book build docs