-
Notifications
You must be signed in to change notification settings - Fork 9
58 lines (52 loc) · 1.7 KB
/
deploy-userguide-website.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
# When changes are pushed to the develop branch,
# build the current version of the User Guide
# with Sphinx and deploy it to the gh-pages branch.
#
# @todo Consolidate checkouts
name: Deploy User Guide (website)
on:
push:
branches: [ master ]
jobs:
build:
name: Deploy to taiwan website
# if: (github.repository == 'codeigniter4/CodeIgniter4')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# Build the latest User Guide
- name: Build with Sphinx
uses: ammaraskar/[email protected]
with:
docs-folder: ./
# Create an artifact of the html output
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: HTML Documentation
path: ./build/html/
# 壓縮產出檔案
- name: Run a multi-line script
run: |
sudo apt-get install zip -y
zip -r user_guide_deploy.zip ./build/html
# 透過 SSH 複製檔案
- name: copy file via ssh
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_KNOWN_HOSTS }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
source: "user_guide_deploy.zip"
target: "/home/cd"
# 透過 SSH 執行佈署指令檔案
- name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_KNOWN_HOSTS }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: bash /home/cd/user_guide_deploy.sh