You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/usr/bin/env sh
###
# @Author: 王文杰
# @Date: 2024-03-22 09:08:28
# @LastEditors: 王文杰
# @LastEditTime: 2024-03-22 10:54:07
# @FilePath: /app-nx-personal/deploy.sh
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
###
# 确保脚本抛出遇到的错误
set -e
# 1. 先提交 master
git push git@github.com:xxx.git master:master
# 2. 打包生成静态文件
# npm run build:h5
# 注意:项目使用了 uniClound需在 HbuilderX 打包 H5 网站,否则无法使用云功能
cli publish --platform h5 --project uni-app --spaceId mp-2fac390c-2ea7-4d12-9726-f5b9a3bb6c37
# 3. 生成流水线.yml
mkdir -p "./dist/build/h5/.github/workflows"
cp "./deploy.yml" "./dist/build/h5/.github/workflows/deploy.yml"
# 4. 进入生成的文件夹,提交到主仓库 app-nx-personal 分支
# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME
cd dist/build/h5
git init -b master
git add -A
git commit -m 'deploy: app-nx-personal'
# 如果发布到 https://<USERNAME>.github.io/<REPO>
# git push -f git@gitee.com:<USERNAME>/<REPO>.git master:gh-pages
git push -f git@github.com:xxx.git master:app-nx-personal
cd -