-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (38 loc) · 1.13 KB
/
main.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
41
name: Deploy
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm i
- run: npm run docs:build --if-present
- if: ${{ github.event_name == 'push' && success() }}
name: Publish HTML to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.SECRET }}
publish_dir: ./public
enable_jekyll: false
- if: ${{ github.event_name == 'push' && success() }}
name: deploy file to server
uses: wlixcc/[email protected]
with:
username: 'root'
server: '${{ secrets.SERVER_IP }}'
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} # 引用之前创建好的secret
local_path: './public/*'
remote_path: "/home/www/htdocs/wangjunliang/FrontEnd-Engineering-Guide/"
sftp_only: false