-
-
Notifications
You must be signed in to change notification settings - Fork 64
68 lines (64 loc) · 1.88 KB
/
deploy-docs.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Deploy Docs to VPS
on:
push:
branches: [ master ]
paths:
- '*/*.md'
- '.docs/**/*'
workflow_dispatch:
inputs:
message:
description: 'Test scenario tags'
workflow_run:
workflows: ["Update Workflow Version"]
types:
- completed
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [ 18 ]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Git checkout
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules
- name: Install Dependencies
run: |
npm install
- name: Build
run: |
npm run docs:initmd
npm run docs:build
- name: SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BLOG_DEPLOY_KEY }}
- name: Deploy VPS
run: |
ssh-keyscan alfred.1991421.cn >> ~/.ssh/known_hosts
rsync -az -vv --delete -e 'ssh -p ${{ secrets.BLOG_DEPLOY_PORT }}' .docs/.vitepress/dist [email protected]:/var/www/alfred
- name: Notify
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
Alfred Docs update completed, see here(https://alfred.1991421.cn).
See code(https://github.com/${{github.repository}})
format: markdown