blog-hexo/.gitea/workflows/build.yml

40 lines
829 B
YAML
Raw Normal View History

2024-06-04 10:55:56 +08:00
name: Build Project
on:
push:
branches:
- master
jobs:
build:
2024-06-04 13:11:42 +08:00
runs-on: ubuntu-latest
2024-06-04 10:55:56 +08:00
steps:
- name: Checkout repository
uses: actions/checkout@v2
2024-06-04 13:42:24 +08:00
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18' # or specify the version you need
2024-06-04 13:17:39 +08:00
- name: Install pnpm
run: npm i -g pnpm hexo
2024-06-04 10:55:56 +08:00
2024-06-04 13:17:39 +08:00
- name: Install dependencies
run: pnpm install
2024-06-04 10:55:56 +08:00
2024-06-04 13:17:39 +08:00
- name: hexo clean
run: hexo cl
2024-06-04 10:55:56 +08:00
2024-06-04 13:17:39 +08:00
- name: hexo generate
run: hexo g
2024-06-04 10:55:56 +08:00
2024-06-04 13:17:39 +08:00
- name: build algolia search index
2024-06-04 13:42:24 +08:00
run: pnpm run search
- name: Copy files to remote server
run: |
scp -r public/* root@maxshader.com:/www/wwwroot/caddy/html/blog-hexo
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}