Skip to content

Commit e2e5363

Browse files
committed
Use peaceiris/actions-gh-pages for proper CNAME handling
1 parent 4ba2a6c commit e2e5363

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

.github/workflows/bonsai-docs.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,30 @@ jobs:
77
steps:
88
- name: Checkout
99
uses: actions/checkout@v4
10-
- working-directory: ./
10+
- name: Set up Python
11+
uses: actions/setup-python@v4
12+
with:
13+
python-version: '3.x'
14+
- name: Clone IfcOpenShell
1115
env:
1216
GH_APIKEY: ${{ secrets.GH_APIKEY }}
13-
GH_TOKEN: ${{ secrets.GH_APIKEY }}
1417
run: |
15-
sudo apt update && sudo apt install -y python3-pip
16-
pip3 install furo sphinx-autoapi sphinx-copybutton
1718
git clone https://${{ secrets.GH_APIKEY }}@github.com/IfcOpenShell/IfcOpenShell
1819
cd IfcOpenShell
1920
git checkout 5db65f404
20-
cd src/bonsai/docs
21+
- name: Install dependencies
22+
run: |
23+
cd IfcOpenShell/src/bonsai/docs
24+
pip install -r requirements.txt
25+
- name: Build documentation
26+
run: |
27+
cd IfcOpenShell/src/bonsai/docs
2128
make html
22-
git config --global user.name 'IfcOpenBot'
23-
git config --global user.email 'IfcOpenBot@users.noreply.github.com'
24-
git clone https://${{ secrets.GH_APIKEY }}@github.com/IfcOpenShell/bonsaibim_org_docs
25-
git -C bonsaibim_org_docs checkout -B main
26-
rm -rf bonsaibim_org_docs/*
27-
cp -r _build/html/* bonsaibim_org_docs/
28-
echo "docs.bonsaibim.org" > bonsaibim_org_docs/CNAME
29-
touch bonsaibim_org_docs/.nojekyll
30-
echo "<!-- Build: $(date +%s) -->" >> bonsaibim_org_docs/index.html
31-
git -C bonsaibim_org_docs add .
32-
git -C bonsaibim_org_docs commit -m "Build"
33-
git -C bonsaibim_org_docs push
29+
- name: Deploy to GitHub Pages
30+
uses: peaceiris/actions-gh-pages@v4
31+
with:
32+
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
33+
external_repository: IfcOpenShell/bonsaibim_org_docs
34+
publish_branch: main
35+
cname: docs.bonsaibim.org
36+
publish_dir: IfcOpenShell/src/bonsai/docs/_build/html

0 commit comments

Comments
 (0)