@@ -2,41 +2,42 @@ name: Architecture Docs
22
33on :
44 push :
5- branches : [main, master, canary ]
5+ branches : [main, master]
66 workflow_dispatch :
77
88permissions :
99 contents : read
1010
11- concurrency :
12- group : pages
13- cancel-in-progress : true
14-
1511jobs :
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 : /pytorch/
21+ base-url : https://repos.supermodeltools.com
3422
35- - name : Install wrangler
36- run : npm install -g wrangler@3
37-
38- - name : Deploy to Cloudflare Pages
23+ - name : Deploy to central site
3924 env :
40- CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
41- CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
42- run : wrangler pages deploy ./arch-docs-output --project-name=gtd-pytorch --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