43 lines
1.0 KiB
YAML
43 lines
1.0 KiB
YAML
name: Deploy Pages
|
|
run-name: ${{ gitea.event.head_commit.message }}
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
Generate-Pages:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '16'
|
|
- name: Install dependencies
|
|
run: npm install
|
|
- name: Generate pages
|
|
run: hexo generate
|
|
- name: Upload generated pages
|
|
uses: actions/upload-artifact@v4
|
|
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 }}
|