feat: update deploy workflow
Some checks failed
Deploy Pages / Generate-Pages (push) Failing after 5s

This commit is contained in:
Linloir 2024-10-09 23:12:11 +08:00
parent 0bf45eed49
commit 422fa4dc09
Signed by: Linloir
GPG Key ID: 3D6B9EC35C923C81

View File

@ -9,6 +9,10 @@ on:
jobs: jobs:
Generate-Pages: Generate-Pages:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -20,23 +24,21 @@ jobs:
run: npm install run: npm install
- name: Generate pages - name: Generate pages
run: hexo generate run: hexo generate
- name: Upload generated pages - name: Copy pages
uses: actions/upload-artifact@v4 run: cp -r public/* ../pages
- name: Checkout to `publish` branch
run: git checkout publish
- name: Remove old files
run: rm -rf `ls | grep -v .git`
- name: Copy new files
run: cp -r ../pages/* .
- name: Commit and Push back Changes
use: https://github.com/stefanzweifel/git-auto-commit-action@v5
with: with:
name: generated-pages-${{ github.run_id }} commit_message: "Auto deploy pages"
path: public commit_user_name: "Gitea-Actions[bot]"
if-no-files-found: error commit_user_email: "41898282+gitea-actions[bot]@users.noreply.gitea.com"
overwrite: true branch: publish
include-hidden-files: true commit_options: "--no-verify"
compression-level: 5 - name: Call API to Update Caddy
run: curl https://upd.linloir.cn/update/blog.linloir.gitea.linloir.cn
Deploy-Pages:
runs-on: nas-host
steps:
- name: Remove old pages
run: rm -rf ${{ env.PAGE_ROOT }}/*
- name: Download generated pages
uses: actions/download-artifact@v4
with:
name: generated-pages-${{ github.run_id }}
path: ${{ env.PAGE_ROOT }}