-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.22 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
name: Deploy CSlant Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Deploy to Remote Host
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST_WEB_2 }}
username: ${{ secrets.REMOTE_USERNAME_WEB_2 }}
password: ${{ secrets.REMOTE_PASS_WEB_2 }}
key: ${{ secrets.SSH_PRIVATE_KEY_WEB_2 }}
port: ${{ secrets.REMOTE_PORT_WEB_2 }}
script: |
source "$HOME/.nvm/nvm.sh"
nvm use ${{ vars.GLOBAL_NVM_USE_VERSION }}
cd ${{ secrets.DOCS_RUNNER_PATH }}
${{ secrets.DOCS_RUNNER_COMMAND }}
sync-build:
runs-on: self-hosted
needs: deploy
steps:
- name: Sync build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST_WEB_2 }}
username: ${{ secrets.REMOTE_USERNAME_WEB_2 }}
password: ${{ secrets.REMOTE_PASS_WEB_2 }}
key: ${{ secrets.SSH_PRIVATE_KEY_WEB_2 }}
port: ${{ secrets.REMOTE_PORT_WEB_2 }}
script: |
rsync -avz --delete ${{ vars.DOCS_PATH_WEB_2 }}/build/ ${{ vars.NGINX_SERVER_NAME }}:${{ vars.NGINX_SERVER_SYNC_PATH }}/docs/