Skip to content

Commit bcf2262

Browse files
committed
build: pages deploy
1 parent 82f7513 commit bcf2262

File tree

6 files changed

+62
-23
lines changed

6 files changed

+62
-23
lines changed

.github/workflows/pages.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: pages
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
jobs:
9+
pages:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Install pnpm
18+
uses: pnpm/action-setup@v2
19+
20+
- name: Set node version to 16
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: 16
24+
cache: 'pnpm'
25+
26+
- run: pnpm bootstrap
27+
28+
- name: Build Playground site
29+
run: npm run build
30+
31+
- name: clean dist
32+
run: rm -rf dist
33+
34+
- name: mkdir dist
35+
run: mkdir dist && mkdir dist/playground
36+
37+
- name: move to dist
38+
run: mv playground/dist/* dist/playground
39+
40+
- name: Deploy to GitHub Pages
41+
uses: crazy-max/ghaction-github-pages@v2
42+
with:
43+
target_branch: preview-pages
44+
build_dir: dist
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.DS_Store
22
node_modules
33
dist
4-
/github-website
54
# local env files
65
.env.local
76
.env.*.local

.npmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm config set strict-peer-dependencies=false
1+
strict-peer-dependencies=false

package.json

+1-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"clean:modules": "rimraf node_modules **/node_modules **/**/node_modules",
1313
"clean:all": "pnpm clean:top && pnpm clean:modules",
1414
"prepare": "husky install",
15-
"build": "pnpm clean:top && pnpm --filter \"starfish-*\" build",
15+
"build": "pnpm clean:top && cd playground && npm run build",
1616
"build:preview": "pnpm clean:top && pnpm --filter \"starfish-*\" build:preview",
1717
"commit": "git-cz"
1818
},
@@ -69,14 +69,5 @@
6969
"commitizen": {
7070
"path": "./node_modules/cz-conventional-changelog"
7171
}
72-
},
73-
"peerDependencyRules": {
74-
"pnpm": {
75-
"peerDependencyRules": {
76-
"ignoreMissing": [
77-
"eslint-plugin-vue"
78-
]
79-
}
80-
}
8172
}
8273
}

playground/vite.config.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "vite";
22
import vue from "@vitejs/plugin-vue";
33
import * as path from 'path';
4-
const outDir = path.resolve(__dirname, "../preview");
4+
// const outDir = path.resolve(__dirname, "../preview");
55
const alias: any = [
66
{
77
find: "@",
@@ -53,6 +53,7 @@ export default defineConfig({
5353
],
5454
},
5555
},
56+
base: '/starfish-vue3-lowcode/playground',
5657
build: {
5758
cssCodeSplit: false, // 如果设置为false,整个项目中的所有 CSS 将被提取到一个 CSS 文件中
5859
sourcemap: false, // 构建后是否生成 source map 文件。如果为 true,将会创建一个独立的 source map 文件
@@ -64,7 +65,7 @@ export default defineConfig({
6465
// drop_debugger: true, // 生产环境去除debugger
6566
// },
6667
// },
67-
outDir,
68+
// outDir,
6869
rollupOptions: {
6970
input: {
7071
main: path.resolve(__dirname, "index.html"),

pnpm-lock.yaml

+11-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)