-
Notifications
You must be signed in to change notification settings - Fork 13
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
13 changed files
with
535 additions
and
108 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 |
---|---|---|
@@ -1,3 +1,14 @@ | ||
# 生产环境 | ||
# 请求地址 | ||
VITE_APP_API_BASEURL = '/' | ||
# APP 名称 | ||
VITE_APP_TITLE = 'uniAppTemplate' | ||
|
||
# APP ID | ||
VITE_UNI_APPID = '' | ||
# 微信小程序 APP ID | ||
VITE_WX_APPID = 'wxb56964dd28204de0' | ||
|
||
# h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base | ||
VITE_APP_PUBLIC_BASE = / | ||
|
||
# h5是否需要配置代理 | ||
VITE_APP_PROXY = false | ||
VITE_APP_PROXY_PREFIX = '/api' |
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,8 @@ | ||
# 生产环境 | ||
|
||
# 请求地址 | ||
# https://jsonplaceholder.typicode.com 免费模拟数据 | ||
VITE_APP_API_BASEURL = 'https://jsonplaceholder.typicode.com' | ||
|
||
# storage前缀 | ||
VITE_APP_PREFIX = 'storage' |
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,55 @@ | ||
# 工作流的名称,如果省略,则使用当前文件名 | ||
name: Auto Deploy | ||
|
||
# 从工作流生成的工作流运行的名称,如果省略,则使用提交时的commit信息 | ||
run-name: Deploy by @${{ github.actor }} | ||
|
||
# 触发部署的条件 | ||
on: | ||
# 每当 push 到 master 分支时触发部署 | ||
push: | ||
branches: | ||
- main | ||
|
||
# 当前流程要执行的任务,可以是多个。[my_first_job]就是一个任务 | ||
jobs: | ||
my_first_job: | ||
name: build-and-deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 6.32.9 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'pnpm' | ||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Run Build Script | ||
run: pnpm run build | ||
|
||
- name: Deploy to GitHub Pages | ||
# 此actions的官方文档 https://github.com/JamesIves/github-pages-deploy-action | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
# 要部署的文件夹,必填 | ||
folder: dist/build/h5 | ||
# 希望部署的分支,默认gh-pages | ||
branch: gh-pages | ||
# # 仓库范围的访问令牌,可以将个人令牌的值存储在GitHub Secrets中 | ||
# # 默认情况是不需要填的,如果您需要更多权限,例如部署到另一个存储库才需要填写 | ||
# # ACCESS_TOKEN 对应GitHub Secrets中设置的字段,不要照搬 | ||
# TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
# # 部署到GitHub的不同仓库 <用户名>/<仓库名> | ||
# # 此选项必须配置了TOKEN才能正常执行 | ||
# REPOSITORY-NAME: leoleor/leo2 |
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 @@ | ||
registry = "http://registry.npmmirror.com" |
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,95 @@ | ||
// manifest.config.ts | ||
import { defineManifestConfig } from '@uni-helper/vite-plugin-uni-manifest' | ||
import path from 'node:path' | ||
import { loadEnv } from 'vite' | ||
|
||
// 获取环境变量的范例 | ||
const env = loadEnv(process.env.NODE_ENV, path.resolve(process.cwd())) | ||
const { VITE_APP_TITLE, VITE_UNI_APPID, VITE_WX_APPID, VITE_APP_PUBLIC_BASE } = env | ||
|
||
export default defineManifestConfig({ | ||
name: VITE_APP_TITLE, | ||
appid: VITE_UNI_APPID, | ||
description: '', | ||
versionName: '1.0.0', | ||
versionCode: '100', | ||
transformPx: false, | ||
locale: 'zh-Hans', | ||
h5: { | ||
router: { | ||
base: VITE_APP_PUBLIC_BASE | ||
} | ||
}, | ||
/* 5+App特有相关 */ | ||
'app-plus': { | ||
usingComponents: true, | ||
nvueStyleCompiler: 'uni-app', | ||
compilerVersion: 3, | ||
compatible: { | ||
ignoreVersion: true | ||
}, | ||
splashscreen: { | ||
alwaysShowBeforeRender: true, | ||
waiting: true, | ||
autoclose: true, | ||
delay: 0 | ||
}, | ||
/* 模块配置 */ | ||
modules: {}, | ||
/* 应用发布信息 */ | ||
distribute: { | ||
/* android打包配置 */ | ||
android: { | ||
minSdkVersion: 30, | ||
targetSdkVersion: 30, | ||
abiFilters: ['armeabi-v7a', 'arm64-v8a'], | ||
permissions: [ | ||
'<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>', | ||
'<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>', | ||
'<uses-permission android:name="android.permission.VIBRATE"/>', | ||
'<uses-permission android:name="android.permission.READ_LOGS"/>', | ||
'<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>', | ||
'<uses-feature android:name="android.hardware.camera.autofocus"/>', | ||
'<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>', | ||
'<uses-permission android:name="android.permission.CAMERA"/>', | ||
'<uses-permission android:name="android.permission.GET_ACCOUNTS"/>', | ||
'<uses-permission android:name="android.permission.READ_PHONE_STATE"/>', | ||
'<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>', | ||
'<uses-permission android:name="android.permission.WAKE_LOCK"/>', | ||
'<uses-permission android:name="android.permission.FLASHLIGHT"/>', | ||
'<uses-feature android:name="android.hardware.camera"/>', | ||
'<uses-permission android:name="android.permission.WRITE_SETTINGS"/>' | ||
] | ||
}, | ||
/* ios打包配置 */ | ||
ios: {}, | ||
/* SDK配置 */ | ||
sdkConfigs: {} | ||
} | ||
}, | ||
/* 快应用特有相关 */ | ||
quickapp: {}, | ||
/* 小程序特有相关 */ | ||
'mp-weixin': { | ||
appid: VITE_WX_APPID, | ||
setting: { | ||
urlCheck: false | ||
}, | ||
usingComponents: true | ||
// __usePrivacyCheck__: true, | ||
}, | ||
'mp-alipay': { | ||
usingComponents: true, | ||
styleIsolation: 'shared' | ||
}, | ||
'mp-baidu': { | ||
usingComponents: true | ||
}, | ||
'mp-toutiao': { | ||
usingComponents: true | ||
}, | ||
uniStatistics: { | ||
enable: false | ||
}, | ||
vueVersion: '3' | ||
}) |
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
Oops, something went wrong.