-
Notifications
You must be signed in to change notification settings - Fork 16
59 lines (50 loc) · 1.54 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy:
name: Build & Deploy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('patches/**') }}
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
- name: Install Dependencies
run: yarn install
- name: Build Site
run: yarn build
env:
VITE_BAOSHUO_CDNJS: true
- name: Deploy site to server (Tokyo, JP)
uses: easingthemes/[email protected]
env:
ARGS: '-avz --delete'
SOURCE: dist/
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
TARGET: ${{ secrets.REMOTE_PATH }}
EXCLUDE: .git,.github,.gitlab-ci.yml,.nojekyll
- name: Deploy site to server (Hong Kong, CN)
uses: easingthemes/[email protected]
env:
ARGS: '-avz --delete'
SOURCE: dist/
REMOTE_HOST: ${{ secrets.REMOTE_HOST_2 }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
TARGET: ${{ secrets.REMOTE_PATH }}
EXCLUDE: .git,.github,.gitlab-ci.yml,.nojekyll