Skip to content

Commit 3b34282

Browse files
committed
Save and restore CNAME when clearing doc repos
1 parent cb4efba commit 3b34282

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/bonsai-docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ jobs:
2222
git config --global user.email 'IfcOpenBot@users.noreply.github.com'
2323
git clone https://${{ secrets.GH_APIKEY }}@github.com/IfcOpenShell/bonsaibim_org_docs
2424
git -C bonsaibim_org_docs checkout -B main
25-
# Delete old content but preserve CNAME for GitHub Pages
26-
find bonsaibim_org_docs -mindepth 1 -not -name "CNAME" -delete
25+
# Save CNAME before clearing repo - needed for GitHub Pages custom domain
26+
cp bonsaibim_org_docs/CNAME /tmp/CNAME || true
27+
rm -rf bonsaibim_org_docs/*
2728
cp -r _build/html/* bonsaibim_org_docs/
29+
cp /tmp/CNAME bonsaibim_org_docs/CNAME || true
2830
touch bonsaibim_org_docs/.nojekyll
2931
git -C bonsaibim_org_docs add .
3032
git -C bonsaibim_org_docs commit -m "Build"

.github/workflows/ifcopenshell-docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ jobs:
2323
git config --global user.email 'IfcOpenBot@users.noreply.github.com'
2424
git clone https://${{ secrets.GH_APIKEY }}@github.com/IfcOpenShell/ifcopenshell_org_docs
2525
git -C ifcopenshell_org_docs checkout -B main
26-
# Delete old content but preserve CNAME for GitHub Pages
27-
find ifcopenshell_org_docs -mindepth 1 -not -name "CNAME" -delete
26+
# Save CNAME before clearing repo - needed for GitHub Pages custom domain
27+
cp ifcopenshell_org_docs/CNAME /tmp/CNAME || true
28+
rm -rf ifcopenshell_org_docs/*
2829
cp -r _build/html/* ifcopenshell_org_docs/
30+
cp /tmp/CNAME ifcopenshell_org_docs/CNAME || true
2931
touch ifcopenshell_org_docs/.nojekyll
3032
git -C ifcopenshell_org_docs add .
3133
git -C ifcopenshell_org_docs commit -m "Build"

0 commit comments

Comments
 (0)