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:
Generate-Pages:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
@ -20,23 +24,21 @@ jobs:
run: npm install
- name: Generate pages
run: hexo generate
- name: Upload generated pages
uses: actions/upload-artifact@v4
- name: Copy pages
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:
name: generated-pages-${{ github.run_id }}
path: public
if-no-files-found: error
overwrite: true
include-hidden-files: true
compression-level: 5
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 }}
commit_message: "Auto deploy pages"
commit_user_name: "Gitea-Actions[bot]"
commit_user_email: "41898282+gitea-actions[bot]@users.noreply.gitea.com"
branch: publish
commit_options: "--no-verify"
- name: Call API to Update Caddy
run: curl https://upd.linloir.cn/update/blog.linloir.gitea.linloir.cn