Skip to content

Commit 807f5e9

Browse files
committed
Update arch-docs workflow to deploy to central site
1 parent ba9a334 commit 807f5e9

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

.github/workflows/arch-docs.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@ name: Architecture Docs
22

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

88
permissions:
99
contents: read
1010

11-
concurrency:
12-
group: pages
13-
cancel-in-progress: true
14-
1511
jobs:
1612
build-and-deploy:
1713
runs-on: ubuntu-latest
@@ -22,13 +18,26 @@ jobs:
2218
id: docs
2319
with:
2420
supermodel-api-key: ${{ secrets.SUPERMODEL_API_KEY }}
25-
base-url: /vue/
26-
27-
- name: Install wrangler
28-
run: npm install -g wrangler@3
21+
base-url: https://repos.supermodeltools.com
2922

30-
- name: Deploy to Cloudflare Pages
23+
- name: Deploy to central site
3124
env:
32-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
33-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
34-
run: wrangler pages deploy ./arch-docs-output --project-name=gtd-vue --branch=main
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)