test: 测试vercel部署

This commit is contained in:
xugaoyi 2021-04-08 20:30:50 +08:00
parent 47c0ea7297
commit 03a3d8f97a
3 changed files with 18 additions and 15 deletions

View File

@ -26,7 +26,7 @@ jobs:
uses: actions/setup-node@v1 # 作用安装nodejs uses: actions/setup-node@v1 # 作用安装nodejs
with: with:
node-version: ${{ matrix.node-version }} # 版本 node-version: ${{ matrix.node-version }} # 版本
- name: run deploy.sh # 步骤3 同时部署到github和coding - name: run deploy.sh # 步骤3
env: # 设置环境变量 env: # 设置环境变量
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} # toKen私密变量 GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} # toKen私密变量
CODING_TOKEN: ${{ secrets.CODING_TOKEN }} CODING_TOKEN: ${{ secrets.CODING_TOKEN }}

View File

@ -9,8 +9,9 @@ npm run build
# 进入生成的文件夹 # 进入生成的文件夹
cd docs/.vuepress/dist cd docs/.vuepress/dist
# deploy to github # deploy to github pages
echo 'b.xugaoyi.com' > CNAME echo 'b.xugaoyi.com' > CNAME
if [ -z "$GITHUB_TOKEN" ]; then if [ -z "$GITHUB_TOKEN" ]; then
msg='deploy' msg='deploy'
githubUrl=git@github.com:xugaoyi/vuepress-theme-vdoing.git githubUrl=git@github.com:xugaoyi/vuepress-theme-vdoing.git
@ -23,20 +24,20 @@ fi
git init git init
git add -A git add -A
git commit -m "${msg}" git commit -m "${msg}"
git push -f $githubUrl master:gh-pages # 推送到github git push -f $githubUrl master:gh-pages # 推送到github gh-pages分支
# deploy to coding # deploy to coding pages
echo 'www.xugaoyi.com\nxugaoyi.com' > CNAME # 自定义域名 # echo 'www.xugaoyi.com\nxugaoyi.com' > CNAME # 自定义域名
echo 'google.com, pub-7828333725993554, DIRECT, f08c47fec0942fa0' > ads.txt # 谷歌广告相关文件 # echo 'google.com, pub-7828333725993554, DIRECT, f08c47fec0942fa0' > ads.txt # 谷歌广告相关文件
if [ -z "$CODING_TOKEN" ]; then # -z 字符串 长度为0则为true$CODING_TOKEN来自于github仓库`Settings/Secrets`设置的私密环境变量 # if [ -z "$CODING_TOKEN" ]; then # -z 字符串 长度为0则为true$CODING_TOKEN来自于github仓库`Settings/Secrets`设置的私密环境变量
codingUrl=git@e.coding.net:xgy/xgy.git # codingUrl=git@e.coding.net:xgy/xgy.git
else # else
codingUrl=https://HmuzsGrGQX:${CODING_TOKEN}@e.coding.net/xgy/xgy.git # codingUrl=https://HmuzsGrGQX:${CODING_TOKEN}@e.coding.net/xgy/xgy.git
fi # fi
git add -A # git add -A
git commit -m "${msg}" # git commit -m "${msg}"
git push -f $codingUrl master # 推送到coding # git push -f $codingUrl master # 推送到coding
cd - # 退回开始所在目录 cd -
rm -rf docs/.vuepress/dist rm -rf docs/.vuepress/dist

View File

@ -110,6 +110,8 @@ article: false
* [jsDelivr](http://www.jsdelivr.com/) 国外的一家优秀的公共 CDN 服务提供商 * [jsDelivr](http://www.jsdelivr.com/) 国外的一家优秀的公共 CDN 服务提供商
* [unpkg](https://unpkg.com/) cdn 服务 * [unpkg](https://unpkg.com/) cdn 服务
### 网站托管
- [vercel](https://vercel.com/) 好用的网站托管服务
### 正则 ### 正则
* [正则可视化](https://regex101.com/) * [正则可视化](https://regex101.com/)