This commit is contained in:
parent
d69aee4c46
commit
4725dc969b
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@ -2,17 +2,17 @@ name: Build and Deploy Quartz Site
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ dev ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository (quartz)
|
- name: Clone repository (quartz)
|
||||||
run: git clone https://github.com/7Wate/wiki-quartz.git /wiki/quartz
|
run: git clone https://github.com/7Wate/wiki-quartz.git $HOME/wiki/quartz
|
||||||
|
|
||||||
- name: Clone repository (wiki)
|
- name: Clone repository (wiki)
|
||||||
run: git clone https://github.com/7Wate/wiki.git /wiki/quartz/content
|
run: git clone https://github.com/7Wate/wiki.git $HOME/wiki/quartz/content
|
||||||
|
|
||||||
- name: Set up Node.js 20
|
- name: Set up Node.js 20
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
@ -22,14 +22,14 @@ jobs:
|
|||||||
- name: Install Quartz dependencies and Build site
|
- name: Install Quartz dependencies and Build site
|
||||||
run: |
|
run: |
|
||||||
# 设置 README 为首页,并且添加标题
|
# 设置 README 为首页,并且添加标题
|
||||||
mv /wiki/quartz/content/README.md /wiki/quartz/content/index.md
|
mv $HOME/wiki/quartz/content/README.md $HOME/wiki/quartz/content/index.md
|
||||||
sed -i '1i ---\ntitle: X·Eden\n---' /wiki/quartz/content/index.md
|
sed -i '1i ---\ntitle: X·Eden\n---' $HOME/wiki/quartz/content/index.md
|
||||||
|
|
||||||
# 进入 Quartz 项目目录,安装依赖并构建网站
|
# 进入 Quartz 项目目录,安装依赖并构建网站
|
||||||
cd /wiki/quartz && npm ci && npx quartz build
|
cd $HOME/wiki/quartz && npm ci && npx quartz build
|
||||||
|
|
||||||
# 创建 public 目录并复制构建结果到此目录
|
# 创建 public 目录并复制构建结果到此目录
|
||||||
mkdir -p /wiki/public/ && cp -r public/* /wiki/public/
|
mkdir -p $HOME/wiki/public/ && cp -r public/* $HOME/wiki/public/
|
||||||
|
|
||||||
- name: Deploy to HTML branch of current repository (A仓库)
|
- name: Deploy to HTML branch of current repository (A仓库)
|
||||||
run: |
|
run: |
|
||||||
@ -38,7 +38,7 @@ jobs:
|
|||||||
git config --global user.email "zhouzhongping@7wate.com"
|
git config --global user.email "zhouzhongping@7wate.com"
|
||||||
|
|
||||||
# 在 public 目录下初始化 git 仓库
|
# 在 public 目录下初始化 git 仓库
|
||||||
cd /wiki/public/ && git init && git add .
|
cd $HOME/wiki/public/ && git init && git add .
|
||||||
|
|
||||||
# 获取当天日期作为提交信息
|
# 获取当天日期作为提交信息
|
||||||
DATE=`date '+%Y-%m-%d'`
|
DATE=`date '+%Y-%m-%d'`
|
||||||
|
Loading…
Reference in New Issue
Block a user