test: 测试ci

This commit is contained in:
xugaoyi 2022-07-11 11:39:10 +08:00
parent df3fad4349
commit 3d09961b23
1 changed files with 13 additions and 3 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: build-and-deploy # 步骤3 - name: Build-and-deploy # 步骤3
run: | run: |
remote_addr=`git remote get-url --push origin` remote_addr=`git remote get-url --push origin`
commit_info=`git describe --all --always --long` commit_info=`git describe --all --always --long`
@ -34,7 +34,17 @@ jobs:
user_email=`git log -1 --pretty=format:'%ae'` user_email=`git log -1 --pretty=format:'%ae'`
deploy_branch=gh-pages deploy_branch=gh-pages
yarn yarn
yarn dev yarn build
cd docs/.vuepress/dist
git config --global init.defaultBranch $deploy_branch
git init
git config user.name ${user_name}
git config user.email ${user_email}
git add -A
git commit -m "auto deploy, $commit_info"
remote_addr=`echo $remote_addr | awk -F'://' '{print $2}'`
remote_addr=https://${user_name}:${{secrets.GITHUB_TOKEN}}@${remote_addr}
git remote add origin ${remote_addr}
git push origin HEAD:$deploy_branch --force # 推送到github $deploy_branch分支
# 只提交到github pages也可以使用github-pages-deploy-action详见: https://github.com/JamesIves/github-pages-deploy-action # 只提交到github pages也可以使用github-pages-deploy-action详见: https://github.com/JamesIves/github-pages-deploy-action