1+ # When changes are pushed to the develop branch,
2+ # build the current version of the User Guide
3+ # with Sphinx and deploy it to the gh-pages branch.
4+ #
5+ # @todo Consolidate checkouts
6+ name : Deploy User Guide (website)
7+
8+ on :
9+ push :
10+ branches : [ master ]
11+ pull_request :
12+ branches : [ master ]
13+
14+ jobs :
15+ build :
16+ name : Deploy to taiwan website
17+ # if: (github.repository == 'codeigniter4/CodeIgniter4')
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v2
22+
23+ # Build the latest User Guide
24+ - name : Build with Sphinx
25+ uses : ammaraskar/sphinx-action@0.4
26+ with :
27+ docs-folder : ./
28+
29+ # Create an artifact of the html output
30+ - name : Upload artifact
31+ uses : actions/upload-artifact@v2
32+ with :
33+ name : HTML Documentation
34+ path : ./build/html/
35+
36+ # 壓縮產出檔案
37+ - name : Run a multi-line script
38+ run : |
39+ sudo apt-get install zip -y
40+ zip -r user_guide_deploy.zip ./build/html
41+
42+ # 透過 SSH 複製檔案
43+ - name : copy file via ssh
44+ uses : appleboy/scp-action@master
45+ with :
46+ host : ${{ secrets.SSH_KNOWN_HOSTS }}
47+ username : ${{ secrets.SSH_USERNAME }}
48+ key : ${{ secrets.SSH_PRIVATE_KEY }}
49+ port : ${{ secrets.SSH_PORT }}
50+ source : " user_guide_deploy.zip"
51+ target : " /home/cd"
52+ # 透過 SSH 執行部屬指令檔案
53+ - name : executing remote ssh commands using ssh key
54+ uses : appleboy/ssh-action@master
55+ with :
56+ host : ${{ secrets.SSH_KNOWN_HOSTS }}
57+ username : ${{ secrets.SSH_USERNAME }}
58+ key : ${{ secrets.SSH_PRIVATE_KEY }}
59+ port : ${{ secrets.SSH_PORT }}
60+ script : bash /home/cd/user_guide_deploy.sh
0 commit comments