Merge pull request #99 from i-Cell-Mobilsoft-Open-Source/feature/97-d… #82
This file contains 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
# This workflow will generate html documentation from asciidoc and publish it to `gh-pages` branch | |
name: Deploy documentation | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
generate-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch [main] | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Compile with Maven | |
run: mvn -B compile --file pom.xml | |
- name: Copy generated docs | |
run: | | |
mkdir docs/generated docs/generated/openapi docs/generated/images | |
mv dookug-document/dookug-document-service/target/openapi docs/generated/openapi/dookug-document-service | |
mv dookug-api/dookug-api-common/target/config_keys.adoc docs/generated/dookug-api-common-config.adoc | |
mv dookug-common/dookug-common-pdfsignature/target/config_keys.adoc docs/generated/dookug-common-pdfsignature-config.adoc | |
- name: set-release-version | |
id: vars | |
run: | | |
sudo apt-get update && sudo apt-get install -y libxml2-utils | |
POM_XML_PROJECT_VERSION=`echo -e 'setns x=http://maven.apache.org/POM/4.0.0\ncat /x:project/x:version/text()' | xmllint --shell pom.xml | grep -v /` | |
echo "POM_XML_PROJECT_VERSION=$POM_XML_PROJECT_VERSION" >> $GITHUB_OUTPUT | |
echo CURRENT_VERSION=${POM_XML_PROJECT_VERSION} | |
# Includes the AsciiDoctor GitHub Pages Action to convert adoc files to html and publish to gh-pages branch | |
- name: Generate with asciidoctor image | |
uses: manoelcampos/asciidoctor-ghpages-action@v2 | |
with: | |
pdf_build: true | |
asciidoctor_params: --attribute release_version=${{steps.vars.outputs.POM_XML_PROJECT_VERSION}} --attribute=generatedDoc | |
# adoc_file_ext: .ascii # default is .adoc | |
source_dir: docs/ # default is . | |
ebook_main_adoc_file: index | |
# slides_build: true | |
# pre_build: | |
# post_build: |