-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
f817040
commit 8e9179a
Showing
3 changed files
with
51 additions
and
53 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build and Deploy | ||
on: | ||
push: | ||
branches: | ||
- master # 这里表示push到master分支就会触发流程,请根据实际情况修改 | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
TZ: Asia/Shanghai | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# 这是github官方的一个action,用于clone该仓库的源码到工作流中, | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
|
||
# 安装node | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.17.0 | ||
cache: yarn | ||
|
||
- name: Install and Build | ||
run: | | ||
yarn install | ||
yarn deploy-build | ||
- name: 获取当前时间 | ||
id: time | ||
shell: bash | ||
run: echo "time=$(date +'%Y-%m-%d %H:%M:%S')" >> ${GITHUB_OUTPUT} | ||
|
||
# 部署 | ||
- name: Deploy 🚀 # 部署 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages # 部署后提交到那个分支 | ||
folder: docs # 存放build后产物的目录 | ||
commit-message: 发布于:${{ steps.time.outputs.time }} # 提交信息 | ||
# token: ${{ secrets.ACCESS_TOKEN }} # token 同仓库可以不填 | ||
# repository-name: kongxiangyiren/kongxiangyiren.github.io #要部署的仓库 请根据实际情况修改 为 用户名/仓库名 同仓库可以不填 | ||
|
This file was deleted.
Oops, something went wrong.
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