Skip to content

Commit 69d5aa7

Browse files
committed
chore: update package.json scripts
1 parent bda27eb commit 69d5aa7

File tree

4 files changed

+86
-4
lines changed

4 files changed

+86
-4
lines changed

.github/workflows/cloudflare.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build and Deploy to Cloudflare
2+
on:
3+
push:
4+
branches: [ 1.x ]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
name: Build Application
10+
permissions:
11+
contents: read
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
23+
- name: Install root dependencies
24+
run: npm install --force
25+
26+
- name: Install antdv-demo dependencies
27+
working-directory: antdv-demo
28+
run: npm install --force
29+
30+
- name: Build application
31+
working-directory: antdv-demo
32+
run: npm run build
33+
34+
- name: Upload build artifacts
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: build-files
38+
path: antdv-demo/_site/
39+
retention-days: 1
40+
41+
deploy:
42+
runs-on: ubuntu-latest
43+
name: Deploy to Cloudflare
44+
needs: build
45+
permissions:
46+
contents: read
47+
deployments: write
48+
steps:
49+
- name: Checkout (for config files)
50+
uses: actions/checkout@v5
51+
with:
52+
sparse-checkout: |
53+
wrangler.jsonc
54+
sparse-checkout-cone-mode: false
55+
56+
- name: Download build artifacts
57+
uses: actions/download-artifact@v4
58+
with:
59+
name: build-files
60+
path: antdv-demo/_site/
61+
62+
- name: Deploy (Workers + Static Assets)
63+
uses: cloudflare/[email protected]
64+
with:
65+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
66+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
67+
command: deploy --config wrangler.jsonc
68+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

antdv-demo/build/webpack.site.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let lessLoaderConfig = require('./lessLoaderConfig')('production');
1212
module.exports = merge(baseWebpackConfig, {
1313
output: {
1414
path: path.resolve(__dirname, '../_site'),
15-
publicPath: 'https://aliyuncdn.antdv.com/v1/',
15+
publicPath: '/',
1616
filename: '[name].[contenthash:8].js',
1717
chunkFilename: '[contenthash:8].async.js',
1818
},

antdv-demo/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"title": "Ant Design Vue",
44
"description": "An enterprise-class UI design language and Vue-based implementation",
55
"scripts": {
6-
"dev": "node --max_old_space_size=4096 build/dev.js",
7-
"start": "cross-env PORT=3001 NODE_ENV=development node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js --config build/webpack.dev.conf.js",
8-
"site": "node --max_old_space_size=4096 scripts/run.js _site",
6+
"dev": "node --openssl-legacy-provider --max_old_space_size=4096 build/dev.js",
7+
"start": "cross-env PORT=3001 NODE_ENV=development node --openssl-legacy-provider --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js --config build/webpack.dev.conf.js",
8+
"build": "node --openssl-legacy-provider --max_old_space_size=4096 scripts/run.js _site",
99
"copy": "node scripts/run.js copy-html",
1010
"prettier": "prettier -c --write '**/*'",
1111
"pretty-quick": "pretty-quick"

wrangler.jsonc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "antdv-v1",
3+
"compatibility_date": "2025-09-19",
4+
"assets": {
5+
"directory": "./antdv-demo/_site",
6+
"not_found_handling": "single-page-application"
7+
},
8+
"routes": [
9+
{
10+
"pattern": "1x.antdv.com/*",
11+
"zone_name": "antdv.com"
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)