Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
137593519 committed Feb 2, 2024
2 parents dc46d2e + 60bc0d5 commit 765c3e0
Show file tree
Hide file tree
Showing 21 changed files with 1,029 additions and 816 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages
name: Deploy Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
branches: ['gh-pages']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -18,12 +14,6 @@ permissions:
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
# Build job
build:
Expand All @@ -37,27 +27,19 @@ jobs:
with:
node-version: '18'
cache: 'pnpm'
- name: Setup Pages
uses: actions/configure-pages@v4
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: dist/build/h5
- name: Restore cache
uses: actions/cache@v3
with:
path: |
dist/build/h5
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
key: ${{ runner.os }}-unibest-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
${{ runner.os }}-unibest-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install dependencies
run: pnpm i
- name: Build with Next.js
- name: Build
run: pnpm build:h5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
47 changes: 47 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,51 @@
// commitlint.config.cjs

module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
// 'body-leading-blank': [2, 'always'], // 主体前有空行,默认就是 always
// 'footer-leading-blank': [2, 'always'], // 末行前有空行,默认就是 always
// 'header-max-length': [2, 'always', 108], // 首行最大长度,默认就是 always,72
// 'subject-empty': [2, 'never'], // 标题不可为空,默认就是 never
// 'type-empty': [2, 'never'], // 类型不可为空,默认就是 never

// 允许的类型
'type-enum': [
2,
'always',
[
'build', // 构造工具、外部依赖(webpack、npm)
'chore', // 不涉及 src、test 的其他修改(构建过程或辅助工具的变更)
'ci', // 修改项目继续集成流程(Travis,Jenkins,GitLab CI,Circle等)
'docs', // 文档
'feat', // 新增功能
'fix', // bug 修复
'perf', // 性能优化
'refactor', // 重构
'revert', // 回退
'style', // 代码风格(不影响代码含义)
'test', // 测试

// 下面几个是自定义新增的
'wip', // 开发中
'refine', // 小优化,没有到 refactor 的程度
],
],
},
}

// @see https://commitlint.js.org/#/reference-rules?id=type-enum
// 默认值为:
// [
// 'build',
// 'chore',
// 'ci',
// 'docs',
// 'feat',
// 'fix',
// 'perf',
// 'refactor',
// 'revert',
// 'style',
// 'test',
// ];
2 changes: 1 addition & 1 deletion env/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_APP_TITLE = 'UniBest App'
VITE_APP_TITLE = 'UniBest Hello'
VITE_APP_PORT = 9100

# github actions 部署地址根路径,用在 manifest.config.ts 里面的 h5.router.base
Expand Down
4 changes: 2 additions & 2 deletions env/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NODE_ENV = 'development'
# 是否去除console 和 debugger
VITE_DELETE_CONSOLE = true

VITE_SERVER_BASEURL = 'https://xxx.com'
VITE_SERVER_BASEURL = 'https://ukw0y1.laf.run'

# github actions 部署地址根路径,用在 manifest.config.ts 里面的 h5.router.base
VITE_APP_PUBLIC_BASE=/unibest/
VITE_APP_PUBLIC_BASE=/hello-unibest/
2 changes: 1 addition & 1 deletion env/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ NODE_ENV = 'development'
# 是否去除console 和 debugger
VITE_DELETE_CONSOLE = false

VITE_SERVER_BASEURL = 'https://xxx.com'
VITE_SERVER_BASEURL = 'https://ukw0y1.laf.run'
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@
"vue-i18n": "9.9.0"
},
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@dcloudio/types": "^3.4.3",
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@dcloudio/types": "^3.4.7",
"@dcloudio/uni-automator": "3.0.0-3090920231225001",
"@dcloudio/uni-cli-shared": "3.0.0-3090920231225001",
"@dcloudio/uni-stacktracey": "3.0.0-3090920231225001",
"@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001",
"@iconify-json/carbon": "^1.1.27",
"@types/node": "^20.11.5",
"@types/node": "^20.11.16",
"@types/wechat-miniprogram": "^3.4.7",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
Expand Down Expand Up @@ -137,16 +137,16 @@
"stylelint-config-standard": "^35.0.0",
"stylelint-config-standard-scss": "^12.0.0",
"terser": "^5.26.0",
"typescript": "^4.9.4",
"unocss": "^0.58.0",
"typescript": "^5.3.3",
"unocss": "^0.58.4",
"unplugin-auto-import": "^0.17.2",
"vite": "4.0.3",
"vite": "^5.0.12",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-restart": "^0.4.0",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vite-svg-loader": "^5.1.0",
"vue-global-api": "^0.4.1",
"vue-tsc": "^1.0.24"
"vue-tsc": "^1.8.27"
}
}
Loading

0 comments on commit 765c3e0

Please sign in to comment.