jpug-doc build #1629
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: Fetch and switch branch | |
| run: | | |
| cd tmp-jpug-doc | |
| git fetch origin doc_ja_16:doc_ja_16 | |
| git switch doc_ja_16 | |
| - name: build16 | |
| working-directory: tmp-jpug-doc | |
| run: | | |
| ./configure | |
| cd doc/src/sgml | |
| make clean | |
| make ORIGINAL=1 html | |
| make postgres-A4.pdf | |
| - name: copy 16current | |
| if: success() | |
| run: | | |
| rm -R jpug-doc/16.4/* | |
| cp -aR tmp-jpug-doc/doc/src/sgml/html jpug-doc/16.4/ | |
| cp -a tmp-jpug-doc/doc/src/sgml/postgres-A4.pdf jpug-doc/16.4/postgresql-16.4-A4.pdf | |
| - 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 | |
| git add -N jpug-doc/16.4/ | |
| if ! git diff --name-only current|grep -E -v "bookindex.html|postgres-A4.pdf" ; | |
| then | |
| if ! git diff --name-only jpug-doc/16.4/|grep -E -v "bookindex.html|postgresql-16.4-A4.pdf" ; | |
| then | |
| echo "Do not update" | |
| exit 0 | |
| fi | |
| 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 jpug-doc/16.4/ index.md | |
| git commit -m "by GitHub Actions [skip ci]" | |
| git push origin master |