From 8a72689fb544bc1b7578457f29a57db66b9a5ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=BC=B9?= <810335188@qq.com> Date: Tue, 12 Sep 2023 09:15:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=87=E6=8D=A2=E4=BC=9A=E5=8E=9Fdep?= =?UTF-8?q?loy=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fdaddc5..8f5aad7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,19 +1,31 @@ +# 工作流名称,可自定义 +name: 自动部署 +# 事件监听,决定什么时候触发该工作流内的任务 on: + # 在master分支推动到github时触发 push: - branches: [master] + branches: [ master ] +# 任务集合,可包含多个任务 jobs: + # 任务名称 build: + # 运行的操作系统 runs-on: ubuntu-latest + permissions: + contents: write + # 步骤集合,可包含多个步骤 steps: - - name: checkout - uses: actions/checkout@v2 - - name: build + # 单个步骤,没有名称,直接使用一个action + - uses: actions/checkout@v2 + # 单个步骤,带有名称,带有参数 + - name: build and deploy run: | - corepack enable - pnpm install - pnpm build - - name: deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist + npm install + npm run build + cd dist + git config --global user.name "juetan" + git config --global user.email "810335188@qq.com" + git init + git add -A + git commit -m "Build through github action" + git push -f "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" master:gh-pages \ No newline at end of file