-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 changed file
with
64 additions
and
0 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,64 @@ | ||
name: Deplo To Github Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
repository_dispatch: | ||
types: | ||
- deploy | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 检查分支 | ||
uses: actions/checkout@master | ||
|
||
- name: 安装node环境 | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: "16.x" | ||
|
||
- name: 安装依赖 | ||
run: | | ||
export TZ='Asia/Shanghai' | ||
npm install --prod | ||
- name: 拉取语雀/Notion的文章 | ||
env: | ||
|
||
|
||
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | ||
NOTION_DATABASE_ID: ${{ secrets.NOTION_DATABASE_ID }} | ||
|
||
run: | | ||
npm run sync | ||
- name: 配置Git用户名邮箱 | ||
run: | | ||
git config --global user.name "lightyisu-ghactions" | ||
git config --global user.email "[email protected]" | ||
- name: 提交yuque拉取的文章到GitHub仓库 | ||
run: | | ||
echo `date +"%Y-%m-%d %H:%M:%S"` begin > time.txt | ||
git add . | ||
git commit -m "更新文档" -a | ||
- name: 推送文章到仓库 | ||
uses: ad-m/github-push-action@master | ||
with: | ||
|
||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: 生成静态文件 | ||
run: | | ||
# 对应package.json中的script.build | ||
npm run build | ||