From 4725dc969b266bfe0ea6a8e8db1f0fba3d8d0ccd Mon Sep 17 00:00:00 2001 From: 7Wate Date: Fri, 6 Sep 2024 10:54:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=EF=BC=9A=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E7=BD=91=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01493621..c3cb5edc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,17 +2,17 @@ name: Build and Deploy Quartz Site on: push: - branches: [ main ] + branches: [ dev ] jobs: build-and-deploy: runs-on: ubuntu-latest steps: - 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) - 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 uses: actions/setup-node@v2 @@ -22,14 +22,14 @@ jobs: - name: Install Quartz dependencies and Build site run: | # 设置 README 为首页,并且添加标题 - mv /wiki/quartz/content/README.md /wiki/quartz/content/index.md - sed -i '1i ---\ntitle: X·Eden\n---' /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---' $HOME/wiki/quartz/content/index.md # 进入 Quartz 项目目录,安装依赖并构建网站 - cd /wiki/quartz && npm ci && npx quartz build + cd $HOME/wiki/quartz && npm ci && npx quartz build # 创建 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仓库) run: | @@ -38,7 +38,7 @@ jobs: git config --global user.email "zhouzhongping@7wate.com" # 在 public 目录下初始化 git 仓库 - cd /wiki/public/ && git init && git add . + cd $HOME/wiki/public/ && git init && git add . # 获取当天日期作为提交信息 DATE=`date '+%Y-%m-%d'`