Skip to content

Commit 2893e23

Browse files
authored
[Docs Site] Move vendored Markdown upload to rclone (#23703)
1 parent 09417f8 commit 2893e23

File tree

2 files changed

+40
-15
lines changed

2 files changed

+40
-15
lines changed

.github/workflows/publish-production.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,44 +33,49 @@ jobs:
3333
name: Deploy to Cloudflare Workers
3434
env:
3535
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
36-
- name: Build vendored Markdown archive
36+
- name: Install rclone
37+
run: sudo -v ; curl https://rclone.org/install.sh | sudo bash
38+
- name: Build vendored Markdown
39+
run: npx tsx bin/generate-index-md.ts
40+
- name: Upload vendored Markdown archives to Vendored Markdown bucket
3741
env:
38-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
42+
AWS_ACCESS_KEY_ID: ${{ secrets.VENDORED_DEVDOCS_ACCESS_KEY_ID }}
43+
AWS_SECRET_ACCESS_KEY: ${{ secrets.VENDORED_DEVDOCS_SECRET_ACCESS_KEY }}
3944
run: |
40-
npx tsx bin/generate-index-md.ts
4145
cd distmd && zip -r markdown.zip .
42-
npx wrangler r2 object put vendored-markdown/markdown.zip --file=markdown.zip --remote
46+
rclone cp \
47+
--config bin/rclone.conf \
48+
distmd/markdown.zip \
49+
devdocs:/vendored-markdown/markdown.zip
4350
rm markdown.zip
4451
cd ..
4552
4653
cd distllms
4754
for file in $(find . -type f); do
48-
npx wrangler r2 object put vendored-markdown/$file --file=$file --remote
55+
rclone cp \
56+
--config bin/rclone.conf \
57+
$file \
58+
devdocs:/vendored-markdown/$file
4959
done
50-
- name: Install rclone
51-
run: sudo -v ; curl https://rclone.org/install.sh | sudo bash
60+
cd ..
5261
- name: Upload vendored Markdown files to ZT DevDocs bucket
5362
env:
5463
AWS_ACCESS_KEY_ID: ${{ secrets.ZT_DEVDOCS_ACCESS_KEY_ID }}
5564
AWS_SECRET_ACCESS_KEY: ${{ secrets.ZT_DEVDOCS_SECRET_ACCESS_KEY }}
5665
run: |
5766
rclone sync \
58-
--s3-env-auth \
59-
--s3-provider="Cloudflare" \
60-
--s3-endpoint="https://e76c849bd111ee7d3006b6625713991e.r2.cloudflarestorage.com" \
67+
--config bin/rclone.conf \
6168
distmd \
62-
:s3:/zt-dashboard-dev-docs
69+
zt:/zt-dashboard-dev-docs
6370
- name: Upload vendored Markdown files to AutoRAG DevDocs bucket
6471
env:
6572
AWS_ACCESS_KEY_ID: ${{ secrets.AUTORAG_DEVDOCS_ACCESS_KEY_ID }}
6673
AWS_SECRET_ACCESS_KEY: ${{ secrets.AUTORAG_DEVDOCS_SECRET_ACCESS_KEY }}
6774
run: |
6875
rclone sync \
69-
--s3-env-auth \
70-
--s3-provider="Cloudflare" \
71-
--s3-endpoint="https://cf9267a5bf4f6b3cceca48d554d81679.r2.cloudflarestorage.com" \
76+
--config bin/rclone.conf \
7277
distmd \
73-
:s3:/developer-docs-full
78+
autorag:/developer-docs-full
7479
- uses: actions/cache/save@v4
7580
if: always()
7681
with:

bin/rclone.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[devdocs]
2+
type = s3
3+
provider = Cloudflare
4+
env_auth = true
5+
endpoint = https://b54f07a6c269ecca2fa60f1ae4920c99.r2.cloudflarestorage.com
6+
acl = private
7+
8+
[zt]
9+
type = s3
10+
provider = Cloudflare
11+
env_auth = true
12+
endpoint = https://e76c849bd111ee7d3006b6625713991e.r2.cloudflarestorage.com
13+
acl = private
14+
15+
[autorag]
16+
type = s3
17+
provider = Cloudflare
18+
env_auth = true
19+
endpoint = https://cf9267a5bf4f6b3cceca48d554d81679.r2.cloudflarestorage.com
20+
acl = private

0 commit comments

Comments
 (0)