-
Notifications
You must be signed in to change notification settings - Fork 60
82 lines (69 loc) · 1.9 KB
/
build.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build Docs
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 10
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Install OS dependencies
run: |
sudo apt update
sudo apt install -y texlive-xetex texlive-lang-chinese texlive-fonts-recommended texlive-fonts-extra fonts-freefont-otf latexmk xindy
pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
pip install -r requirements.txt
- name: Build docs
run: |
make html
make latexpdf
- name: Checkout gh-pages
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: gh-pages
path: 'gh-pages'
clean: false
- name: Update gh-pages
run: |
cd ./build/html
rm .buildinfo
zip -r ./codeigniter_user_guide.zip ./
cd ../latex
cp CodeIgniter.pdf ../../gh-pages/
cd ../../gh-pages
cp -Rf ../build/html/* .
- name: Commit changes
run: |
cd gh-pages
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
git add -f .
git commit -m "Deploy to GitHub Pages"
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: 'gh-pages'