chore: update build scripts and add Cloudflare deployment workflow
parent
646de93ed5
commit
e1d2133118
|
@ -0,0 +1,63 @@
|
||||||
|
name: Build and Deploy to Cloudflare
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ 3.x ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Build Application
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install --force
|
||||||
|
|
||||||
|
- name: Build application
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-files
|
||||||
|
path: site/dist/
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Deploy to Cloudflare
|
||||||
|
needs: build
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
deployments: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout (for config files)
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
sparse-checkout: |
|
||||||
|
wrangler.jsonc
|
||||||
|
sparse-checkout-cone-mode: false
|
||||||
|
|
||||||
|
- name: Download build artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-files
|
||||||
|
path: site/dist/
|
||||||
|
|
||||||
|
- name: Deploy (Workers + Static Assets)
|
||||||
|
uses: cloudflare/wrangler-action@v3.14.1
|
||||||
|
with:
|
||||||
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
command: deploy --config wrangler.jsonc
|
||||||
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -33,7 +33,7 @@
|
||||||
"precompile": "npm run version",
|
"precompile": "npm run version",
|
||||||
"pretest": "npm run version",
|
"pretest": "npm run version",
|
||||||
"predist": "npm run version",
|
"predist": "npm run version",
|
||||||
"presite": "npm run version",
|
"prebuild": "npm run version",
|
||||||
"dev": "npm run predev && npm run routes && vite serve site",
|
"dev": "npm run predev && npm run routes && vite serve site",
|
||||||
"test": "cross-env NODE_ENV=test jest --config .jest.js",
|
"test": "cross-env NODE_ENV=test jest --config .jest.js",
|
||||||
"compile": "node antd-tools/cli/run.js compile",
|
"compile": "node antd-tools/cli/run.js compile",
|
||||||
|
@ -56,8 +56,7 @@
|
||||||
"routes": "node site/scripts/genrateRoutes.js",
|
"routes": "node site/scripts/genrateRoutes.js",
|
||||||
"tsc": "tsc --noEmit",
|
"tsc": "tsc --noEmit",
|
||||||
"vue-tsc": "vue-tsc --noEmit",
|
"vue-tsc": "vue-tsc --noEmit",
|
||||||
"site": "npm run routes && ./node_modules/vite/bin/vite.js build site --base=https://3x.antdv.com/",
|
"build": "npm run routes && ./node_modules/vite/bin/vite.js build site --base=/",
|
||||||
"pub:site": "npm run site && node site/scripts/pushToOSS.js",
|
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"version": "node ./scripts/generate-version",
|
"version": "node ./scripts/generate-version",
|
||||||
"sort-api": "node antd-tools/cli/run.js sort-api-table"
|
"sort-api": "node antd-tools/cli/run.js sort-api-table"
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"name": "antdv-v3",
|
||||||
|
"compatibility_date": "2025-09-19",
|
||||||
|
"assets": {
|
||||||
|
"directory": "./site/dist",
|
||||||
|
"not_found_handling": "single-page-application"
|
||||||
|
},
|
||||||
|
"routes": [
|
||||||
|
{
|
||||||
|
"pattern": "3x.antdv.com/*",
|
||||||
|
"zone_name": "antdv.com"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue