Skip to content

Commit 557d9e8

Browse files
committed
revert back to reusing build code, and set FAST_DOCS based on job type
1 parent b5126e9 commit 557d9e8

2 files changed

Lines changed: 13 additions & 36 deletions

File tree

.github/workflows/build_docs.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ jobs:
3838
env:
3939
QUACC_CONFIG_FILE: docs/.quacc.yml
4040
HF_TOKEN: ${{ secrets.HF_TOKEN }}
41-
FAST_DOCS: true
41+
# Set FAST_DOCS only if not a push to main
42+
FAST_DOCS: ${{ (github.event_name != 'push' || github.ref != 'refs/heads/main') && 'true' || '' }}
4243
run: |
4344
jupyter-book build docs
45+
46+
- name: Upload documentation artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: docs-html
50+
path: docs/_build/html/*

.github/workflows/deploy_docs.yml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,12 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: 4-core-ubuntu-gpu-t4
12+
uses: ./.github/workflows/build_docs.yml
13+
secrets: inherit
1314

14-
steps:
15-
- name: Checkout PR code
16-
uses: actions/checkout@v4
17-
with:
18-
ref: ${{ github.event.pull_request.head.sha }}
19-
fetch-depth: 0
20-
21-
- name: Install pandoc
22-
run: sudo apt-get -y install pandoc
23-
24-
# Install dependencies
25-
- name: Set up Python
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: 3.12
29-
30-
- name: Install dependencies
31-
run: |
32-
python -m pip install --upgrade pip
33-
pip install -e packages/fairchem-core[docs,adsorbml,quacc] -e packages/fairchem-data-oc[dev] -e packages/fairchem-applications-cattsunami
34-
35-
# Build the book
36-
- name: Build the book
37-
env:
38-
QUACC_CONFIG_FILE: docs/.quacc.yml
39-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
40-
run: |
41-
jupyter-book build docs
42-
43-
- name: Upload documentation artifact
44-
uses: actions/upload-artifact@v4
45-
with:
46-
name: docs-html
47-
path: docs/_build/html/*
15+
deploy:
16+
needs: build
17+
runs-on: ubuntu-latest
4818

4919
deploy:
5020
needs: build

0 commit comments

Comments
 (0)