Skip to content

Commit 806097e

Browse files
author
niuweili
committed
Merge branch 'codex/upload-openapi-json-oss' into test
2 parents 498cb57 + beb46dc commit 806097e

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

.github/workflows/integration-docs-upload.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Upload integration docs to OSS
22

3+
env:
4+
CDN_URL: 'https://docs-cdn.flashcat.cloud'
5+
36
on:
47
push:
58
branches: [main, test]
@@ -66,7 +69,6 @@ jobs:
6669
CDN_BUCKET: ${{ secrets.CDN_BUCKET }}
6770
CDN_REGION: ${{ secrets.CDN_REGION }}
6871
CDN_ENDPOINT: ${{ secrets.CDN_ENDPOINT }}
69-
CDN_URL: ${{ secrets.CDN_URL }}
7072
CDN_DIR: '/test/docs'
7173
run: npm run upload
7274

@@ -96,6 +98,5 @@ jobs:
9698
CDN_BUCKET: ${{ secrets.CDN_BUCKET }}
9799
CDN_REGION: ${{ secrets.CDN_REGION }}
98100
CDN_ENDPOINT: ${{ secrets.CDN_ENDPOINT }}
99-
CDN_URL: ${{ secrets.CDN_URL }}
100101
CDN_DIR: '/docs'
101102
run: npm run upload

.github/workflows/openapi-json-upload.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Upload OpenAPI JSON to OSS
22

3+
env:
4+
CDN_URL: 'https://docs-cdn.flashcat.cloud'
5+
36
on:
47
push:
58
branches: [main, test]
@@ -67,7 +70,6 @@ jobs:
6770
CDN_BUCKET: ${{ secrets.CDN_BUCKET }}
6871
CDN_REGION: ${{ secrets.CDN_REGION }}
6972
CDN_ENDPOINT: ${{ secrets.CDN_ENDPOINT }}
70-
CDN_URL: ${{ secrets.CDN_URL }}
7173
CDN_DIR: '/test/docs'
7274
run: npm run upload:openapi
7375

@@ -97,6 +99,5 @@ jobs:
9799
CDN_BUCKET: ${{ secrets.CDN_BUCKET }}
98100
CDN_REGION: ${{ secrets.CDN_REGION }}
99101
CDN_ENDPOINT: ${{ secrets.CDN_ENDPOINT }}
100-
CDN_URL: ${{ secrets.CDN_URL }}
101102
CDN_DIR: '/docs'
102103
run: npm run upload:openapi

integration-docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "flashduty-knowledge-base",
3-
"version": "1.3.9",
2+
"name": "@flashcatcloud/flashduty-docs",
3+
"version": "0.0.1",
44
"description": "Flashduty integration documentation compatibility bundle",
55
"type": "module",
66
"engines": {

integration-docs/scripts/upload-openapi.test.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ test('buildCdnUrl rewrites the OSS endpoint URL to the public CDN URL', () => {
4444
buildCdnUrl(
4545
'https://flashcat-docs.oss-cn-hangzhou.aliyuncs.com/docs/api-reference/openapi.en.json',
4646
'flashcat-docs.oss-cn-hangzhou.aliyuncs.com',
47-
'https://download.flashcat.cloud'
47+
'https://docs-cdn.flashcat.cloud'
4848
),
49-
'https://download.flashcat.cloud/docs/api-reference/openapi.en.json'
49+
'https://docs-cdn.flashcat.cloud/docs/api-reference/openapi.en.json'
5050
);
5151
});
5252

@@ -78,7 +78,7 @@ test('uploadOpenapiJsonFiles uploads every JSON file and refreshes each CDN URL'
7878
CDN_BUCKET: 'bucket',
7979
CDN_REGION: 'oss-cn-hangzhou',
8080
CDN_ENDPOINT: 'bucket.oss-cn-hangzhou.aliyuncs.com',
81-
CDN_URL: 'https://download.flashcat.cloud',
81+
CDN_URL: 'https://docs-cdn.flashcat.cloud',
8282
CDN_DIR: '/docs'
8383
};
8484
const ossClient = {
@@ -110,8 +110,8 @@ test('uploadOpenapiJsonFiles uploads every JSON file and refreshes each CDN URL'
110110
assert.deepEqual(
111111
refreshed,
112112
[
113-
'https://download.flashcat.cloud/docs/api-reference/openapi.en.json',
114-
'https://download.flashcat.cloud/docs/api-reference/openapi.zh.json'
113+
'https://docs-cdn.flashcat.cloud/docs/api-reference/openapi.en.json',
114+
'https://docs-cdn.flashcat.cloud/docs/api-reference/openapi.zh.json'
115115
]
116116
);
117117
assert.equal(uploaded[0].options.headers['Content-Type'], 'application/json; charset=utf-8');

0 commit comments

Comments
 (0)