-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1023 Bytes
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: deploy-hexo-blog
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Install Node.js
- name: install nodejs
uses: actions/setup-node@v3.4.1
with:
node-version: "20.12.0"
# Use pnpm package manager
- name: use pnpm
run: npm i -g pnpm && pnpm config set registry https://registry.npmmirror.com
# Install dependencies
- name: install packages
run: pnpm install --no-frozen-lockfile
# Build the Hexo project
- name: build
run: pnpm run build
# Deploy the project to the server
- name: deploy to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
password: ${{ secrets.REMOTE_PASSWORD }}
port: ${{ secrets.REMOTE_PORT }}
source: "dist/"
target: ${{ secrets.REMOTE_TARGET }}