Skip to content

Merge pull request #2 from wmo-im/tk-updates-2024-06-11 #2

Merge pull request #2 from wmo-im/tk-updates-2024-06-11

Merge pull request #2 from wmo-im/tk-updates-2024-06-11 #2

Workflow file for this run

name: WIS2 Cookbook
on:
push:
branches:
- main
env:
FILE_BASENAME: wis2-cookbook-DRAFT
jobs:
build-wis2-cookbook:
name: Generate documentation
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update -y \
&& sudo apt-get install -y pandoc \
&& sudo gem install asciidoctor asciidoctor-pdf
- name: checkout repository
uses: actions/checkout@v3
- name: build documentation
run: |
cd cookbook \
&& asciidoctor --trace -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.html index.adoc \
&& asciidoctor -a allow-uri-read --trace --backend docbook --out-file - index.adoc | pandoc --from docbook --to docx --output /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.docx \
&& asciidoctor -a allow-uri-read --trace -r asciidoctor-pdf --trace -b pdf -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.pdf index.adoc \
&& cd ..
- name: checkout gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages
- name: update gh-pages branch and publish
run: |
git checkout gh-pages
git config --global user.email "[email protected]"
git config --global user.name "Tom Kralidis"
rm -rf cookbook
mv -f /tmp/wis2-cookbook/* .
git add .
git commit -am "update WIS2 Guide build"
git push