Skip to content

Commit 87017cc

Browse files
committed
Update arch-docs workflow to deploy to central site
1 parent f6d0ced commit 87017cc

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

.github/workflows/arch-docs.yml

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,42 @@ 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
1814
steps:
1915
- uses: actions/checkout@v4
2016

21-
- name: Trim non-essential directories
22-
run: |
23-
for dir in test tests __tests__ spec specs benchmarks bench docs documentation \
24-
examples example fixtures migrations assets third_party caffe2 \
25-
.yarn .cache e2e integration_tests testdata; do
26-
rm -rf "$dir" || true
27-
done
28-
2917
- uses: supermodeltools/arch-docs@main
3018
id: docs
3119
with:
3220
supermodel-api-key: ${{ secrets.SUPERMODEL_API_KEY }}
33-
base-url: /bun/
21+
base-url: https://repos.supermodeltools.com
3422

35-
- name: Diagnose output
36-
run: |
37-
echo "Total files: $(find ./arch-docs-output -type f | wc -l)"
38-
echo "By extension:"
39-
find ./arch-docs-output -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -20
40-
41-
- name: Install wrangler
42-
run: npm install -g wrangler@3
43-
44-
- name: Deploy to Cloudflare Pages
23+
- name: Deploy to central site
4524
env:
46-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
47-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
48-
run: wrangler pages deploy ./arch-docs-output --project-name=gtd-bun --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)