33 lines
717 B
YAML
33 lines
717 B
YAML
name: Build Hexo Site
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://gitea.com/actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: https://gitea.com/actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Cache npm dependencies
|
|
uses: https://gitea.com/actions/cache@v4
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Build Hexo
|
|
run: npm run build
|