-
Notifications
You must be signed in to change notification settings - Fork 9
50 lines (45 loc) · 1.48 KB
/
deploy-userguide-latest.yml
File metadata and controls
50 lines (45 loc) · 1.48 KB
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
# 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 (latest)
on:
push:
branches: [ dev ]
jobs:
build:
name: Deploy to gh-pages
# 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/sphinx-action@0.4
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/
# Commit changes to the gh-pages branch
- name: Commit changes
run: |
git clone https://github.com/monkenWu/codeIgniter4-taiwan-User-Guide.git --branch gh-pages --single-branch gh-pages
cp -r ./build/html/* gh-pages/
cd gh-pages
git config --local user.email "action@github.com"
git config --local user.name "${GITHUB_ACTOR}"
git add .
# Ignore failures due to lack of changes
git commit -m "Update User Guide" -a || true
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.ACCESS_TOKEN }}