Skip to content

Commit b551e08

Browse files
committed
Update arch-docs workflow to deploy to central site
1 parent 5fd9d0e commit b551e08

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

.github/workflows/arch-docs.yml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,42 @@ name: Architecture Docs
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, master]
66
workflow_dispatch:
77

88
permissions:
99
contents: read
10-
pages: write
11-
id-token: write
12-
13-
concurrency:
14-
group: pages
15-
cancel-in-progress: true
1610

1711
jobs:
1812
build-and-deploy:
1913
runs-on: ubuntu-latest
20-
environment:
21-
name: github-pages
22-
url: ${{ steps.deploy.outputs.page_url }}
2314
steps:
2415
- uses: actions/checkout@v4
2516

2617
- uses: supermodeltools/arch-docs@main
2718
id: docs
2819
with:
2920
supermodel-api-key: ${{ secrets.SUPERMODEL_API_KEY }}
30-
31-
- uses: actions/configure-pages@v5
32-
33-
- uses: actions/upload-pages-artifact@v3
34-
with:
35-
path: ./arch-docs-output
36-
37-
- uses: actions/deploy-pages@v4
38-
id: deploy
21+
base-url: https://repos.supermodeltools.com
22+
23+
- name: Deploy to central site
24+
env:
25+
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
26+
REPO_NAME: ${{ github.event.repository.name }}
27+
run: |
28+
git config --global user.name "supermodel-bot"
29+
git config --global user.email "bot@supermodeltools.com"
30+
git clone https://x-access-token:${BOT_TOKEN}@github.com/GraphTechnologyDevelopers/graphtechnologydevelopers.github.io.git central-site
31+
rm -rf central-site/site/${REPO_NAME}
32+
mkdir -p central-site/site/${REPO_NAME}
33+
cp -r arch-docs-output/. central-site/site/${REPO_NAME}/
34+
cd central-site
35+
git add site/${REPO_NAME}/
36+
git diff --staged --quiet && echo "No changes" && exit 0
37+
git commit -m "Deploy arch-docs for ${REPO_NAME}"
38+
for i in 1 2 3 4 5; do
39+
git push && break
40+
echo "Push failed, retrying in ${i}0s..."
41+
sleep $((i * 10))
42+
git pull --rebase origin main
43+
done

0 commit comments

Comments
 (0)