Skip to content

Commit 78e3efd

Browse files
authored
Merge pull request #32 from monkenWu/gitflow
Gitflow
2 parents dd190b0 + 3c9489d commit 78e3efd

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 (latest)
7+
8+
on:
9+
push:
10+
branches: [ dev ]
11+
pull_request:
12+
branches: [ dev ]
13+
14+
jobs:
15+
build:
16+
name: Deploy to gh-pages
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+
# Commit changes to the gh-pages branch
37+
- name: Commit changes
38+
run: |
39+
git clone https://github.com/monkenWu/codeIgniter4-taiwan-User-Guide.git --branch gh-pages --single-branch gh-pages
40+
cp -r ./build/html/* gh-pages/
41+
cd gh-pages
42+
git config --local user.email "action@github.com"
43+
git config --local user.name "${GITHUB_ACTOR}"
44+
git add .
45+
# Ignore failures due to lack of changes
46+
git commit -m "Update User Guide" -a || true
47+
- name: Push changes
48+
uses: ad-m/github-push-action@v0.6.0
49+
with:
50+
branch: gh-pages
51+
directory: gh-pages
52+
github_token: ${{ secrets.ACCESS_TOKEN }}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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

Comments
 (0)