-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
352 changed files
with
42,998 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# 1. 为工作流定义名字 | ||
name: 「GitHub Pages」Build & Deploy | ||
|
||
# 2. 触发条件修改为: 当 main 或 master 分支, 有 push 的时候, 执行任务 | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- admin | ||
|
||
# 3. 创建工作流 | ||
jobs: | ||
build: # 工作流名称 | ||
runs-on: ubuntu-latest # 依赖环境 | ||
|
||
steps: # 工作流步骤 | ||
# step 1. 获取源码, 拉取仓库代码 | ||
- name: Chekcout 🛎️ # 步骤名 | ||
uses: actions/checkout@master # 使用插件 => https://github.com/actions/checkout | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install | ||
|
||
# step 3. 安装依赖并打包 | ||
- name: Install and Build 🔧 | ||
run: | | ||
pnpm config set registry https://registry.npmmirror.com | ||
pnpm build:admin | ||
# step 4. 项目部署, 将打包后的产物合并到指定的分支上 | ||
- name: Deploy 🚀 # 步骤名 | ||
uses: JamesIves/[email protected] # 使用插件 => https://github.com/JamesIves/github-pages-deploy-action | ||
with: | ||
BRANCH: gh-pages # 部署分支 | ||
FOLDER: gbeata-dist # 打包, 静态资源输出的目录 | ||
|
||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_PACKAGE }} | ||
run: | | ||
cd ./apps/admin | ||
npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Notify WeChat on Tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
notify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Extract Release Note | ||
id: extract_note | ||
run: echo ::set-output name=note::$(git show -s --format=%b ${{ github.sha }}) | ||
|
||
- name: Debug Release Note | ||
run: echo "Release Note:${{ steps.extract_note.outputs.note }}" | ||
|
||
- name: Send notification to WeChat | ||
run: | | ||
curl -H "Content-Type: application/json" \ | ||
-X POST \ | ||
-d "{\"msgtype\": \"text\", \"text\": {\"content\": \"New tag created: ${{ github.ref }}\\nRelease Note: ${{ steps.extract_note.outputs.note }}\"}}" \ | ||
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9875c111-57b0-42c4-a301-cdaed5e215cc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ dist-ssr | |
server/dist | ||
public/dist | ||
es | ||
lib | ||
lib | ||
gbeata-dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"yaml.schemas": { | ||
"https://json.schemastore.org/github-workflow.json": "file:///Users/niyonggui/multiway/learn/2024/pnpm-monorepo-mui/.github/workflows/deploy-ui.yml" | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
VITE_APP_BASE_API: | ||
|
||
VITE_APP_BASE_URL: './' | ||
|
||
VITE_PORT: 3100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
VITE_APP_BASE_API: | ||
|
||
VITE_APP_BASE_URL: '/react-antd-admin-pnpm/' |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
extends: ['gbeata-eslint'], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: ['./tsconfig.json'], | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-unused-expressions': 'off', | ||
}, | ||
}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Gbeata Admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
declare type Recordable<T = any> = Record<string, T>; | ||
|
||
interface ViteEnv { | ||
VITE_PORT: number | ||
VITE_PROXY: [string, string][] | ||
VITE_DROP_CONSOLE: boolean | ||
} | ||
|
||
// read all environment variable configuration files to process.env | ||
export function wrapperEnv(envConf: Recordable): ViteEnv { | ||
const result: any = {}; | ||
|
||
for (const envName of Object.keys(envConf)) { | ||
let realName = envConf[envName].replace(/\\n/g, '\n'); | ||
realName = realName === 'true' ? true : realName === 'false' ? false : realName; | ||
|
||
if (envName === 'VITE_PORT') { | ||
realName = Number(realName); | ||
} | ||
|
||
if (envName === 'VITE_PROXY' && realName) { | ||
try { | ||
realName = JSON.parse(realName.replace(/'/g, '"')); | ||
} catch (error) { | ||
realName = ''; | ||
} | ||
} | ||
|
||
result[envName] = realName; | ||
|
||
if (typeof realName === 'string') { | ||
process.env[envName] = realName; | ||
} else if (typeof realName === 'object') { | ||
process.env[envName] = JSON.stringify(realName); | ||
} | ||
} | ||
|
||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>react-admin-design</title> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
charset="UTF-8" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css" | ||
/> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.