-
Notifications
You must be signed in to change notification settings - Fork 1
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
218 changed files
with
1,140 additions
and
1,062 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,48 +1,108 @@ | ||
# name: CI | ||
|
||
# #on: [push] | ||
|
||
# # 在master分支发生push事件时触发。 | ||
# on: | ||
# push: | ||
# branches: | ||
# - master | ||
|
||
# env: # 设置环境变量 | ||
# TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用该时区时间) | ||
|
||
# jobs: | ||
# build: # 自定义名称 | ||
# runs-on: ubuntu-latest # 运行在虚拟机环境ubuntu-latest | ||
|
||
# strategy: | ||
# matrix: | ||
# node-version: [18.x] | ||
|
||
# steps: | ||
# - name: Checkout # 步骤1 | ||
# uses: actions/checkout@v1 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions | ||
# - name: Use Node.js ${{ matrix.node-version }} # 步骤2 | ||
# uses: actions/setup-node@v3 # 作用:安装nodejs | ||
# with: | ||
# node-version: ${{ matrix.node-version }} # 版本 | ||
# - name: Build-and-deploy # 步骤3 | ||
# run: | | ||
# remote_addr=`git remote get-url --push origin` | ||
# commit_info=`git describe --all --always --long` | ||
# user_name=`git log -1 --pretty=format:'%an'` | ||
# user_email=`git log -1 --pretty=format:'%ae'` | ||
# deploy_branch=gh-pages | ||
# yarn | ||
# 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分支 | ||
|
||
|
||
|
||
|
||
name: CI | ||
|
||
#on: [push] | ||
|
||
# 在master分支发生push事件时触发。 | ||
on: | ||
# 在 master 分支发生 push 事件时触发。 | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: # 设置环境变量 | ||
TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用该时区时间) | ||
TZ: Asia/Shanghai # 时区(设置时区可使页面中的 最近更新时间 使用时区时间) | ||
|
||
jobs: | ||
jobs: # 工作流 | ||
build: # 自定义名称 | ||
runs-on: ubuntu-latest # 运行在虚拟机环境ubuntu-latest | ||
runs-on: ubuntu-latest # 必填,运行在虚拟机环境 ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
node-version: [14.x] | ||
|
||
steps: | ||
- name: Checkout # 步骤1 | ||
uses: actions/checkout@v1 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions | ||
steps: # 步骤1 | ||
- name: Checkout # 步骤1,拉取代码 | ||
# 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions | ||
uses: actions/checkout@v1 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} # 步骤2 | ||
uses: actions/setup-node@v3 # 作用:安装nodejs | ||
uses: actions/setup-node@v1 # 作用:安装nodejs | ||
with: | ||
node-version: ${{ matrix.node-version }} # 版本 | ||
- name: Build-and-deploy # 步骤3 | ||
run: | | ||
remote_addr=`git remote get-url --push origin` | ||
commit_info=`git describe --all --always --long` | ||
user_name=`git log -1 --pretty=format:'%an'` | ||
user_email=`git log -1 --pretty=format:'%ae'` | ||
deploy_branch=gh-pages | ||
yarn | ||
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分支 | ||
|
||
- name: run deploy.sh # 步骤3:执行脚本 deploy.sh | ||
env: # 设置环境变量,未设置则不运行 | ||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} # token | ||
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }} # 私钥 | ||
run: npm install && npm run deploy # 执行 deploy.sh 脚本,位于项目根目录 | ||
|
||
# - name: Push Matser To Gitee # 步骤4:GitHub 内容同步到 Gitee,同步仓库是 master | ||
# uses: wearerequired/git-mirror-action@master | ||
# env: | ||
# SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }} | ||
# with: # 从源到目的地 | ||
# source-repo: '[email protected]:Kele-Bingtang/notes-blog.git' #Github 仓库地址 | ||
# destination-repo: '[email protected]:kele-bingtang/notes-blog.git' #Gitee 仓库地址 | ||
|
||
- name: Build Gitee Pages # 步骤5:自动部署到 Gitee Pages | ||
uses: yanglbme/gitee-pages-action@master | ||
with: | ||
# 注意替换为你的 Gitee 用户名 | ||
gitee-username: jywangyou | ||
# 注意在 Settings -> Secrets 配置 GITEE_PASSWORD | ||
gitee-password: ${{ secrets.GITEE_PASSWORD }} | ||
# 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错 | ||
gitee-repo: jywangyou/notes-blog | ||
# 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在) | ||
branch: gh-pages |
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
Oops, something went wrong.