-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (57 loc) · 1.81 KB
/
main.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
name: jpug-doc build
on:
schedule:
- cron: '11 19 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Preparation of font
run: |
mkdir ~/.fonts/
cp scripts/fonts/* ~/.fonts/
fc-cache -f -v
- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y docbook-xsl libbsd-dev libedit-dev libpam0g-dev libperl-dev libxml2-utils xsltproc fonts-takao-mincho fonts-takao-pgothic fonts-takao-gothic fop
- name: Checkout jpug-doc
uses: actions/checkout@v4
with:
repository: pgsql-jp/jpug-doc
path: tmp-jpug-doc
- name: build
run: |
cd tmp-jpug-doc
./configure
cd doc/src/sgml
make ORIGINAL=1 html
make postgres-A4.pdf
- name: copy current
if: success()
run: |
mkdir -p current
rm -R current/*
cp -aR tmp-jpug-doc/doc/src/sgml/html current/
cp -a tmp-jpug-doc/doc/src/sgml/postgres-A4.pdf current/
- name: setup git config
run: |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
- name: commit push
run: |
git add -N current
if ! git diff --name-only current|grep -E -v "bookindex.html|postgres-A4.pdf" ;
then
echo "Do not update"
exit 0
fi
echo "Update because there is a difference"
sed -i -e "s/last-updated:.*$/last-updated: $(TZ=Asia/Tokyo date "+%Y-%m-%d %T %Z")/" index.md
git add -A current index.md
git commit -m "by GitHub Actions [skip ci]"
git push origin master