Skip to content

jpug-doc build

jpug-doc build #1853

Workflow file for this run

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 "action@github.com"
- 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
sed -i -e "s/<em id=\"update\">.*<\/em>/<em id=\"update\">$(TZ=Asia/Tokyo date "+%Y-%m-%d")<\/em>/" index.md
git add -A current index.md
git commit -m "by GitHub Actions [skip ci]"
git push origin master