mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
0797f4049a
* remove docs generator code from step-generator * add docs generator to dedicated package * add test cases * add entry point for docs generation * make output more readable * read additional defaults * add custo defaults parameters * remove commented code * adjust custom default parameter in workflow * remove conflict leftovers * handle custom default values * remove comment * extract code to function * extract metadata reading to function * do not print empty strings in favor of PIPER_* env vars * extract new code to own metadata file * only reset default on booleans * remove obsolete test case
79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
name: Documentation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
Build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-java@v1
|
|
with:
|
|
java-version: '1.8'
|
|
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.15.x'
|
|
|
|
- name: Install Groovy
|
|
run: sudo apt-get update && sudo apt-get install groovy -y
|
|
|
|
- name: Cache Maven Packages
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ~/.m2/repository
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-maven-
|
|
|
|
- name: Cache Go Packages
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- run: docker pull ppiper/jenkinsfile-runner:latest
|
|
|
|
- name: Generate Groovy Docs
|
|
env:
|
|
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
|
run: documentation/bin/createDocu.sh
|
|
|
|
- name: Generate Golang Docs
|
|
run: go run pkg/documentation/generator.go --docuDir=documentation/docs/steps/ --customDefaultFile resources/default_pipeline_environment.yml
|
|
|
|
- run: docker pull squidfunk/mkdocs-material:3.0.4
|
|
|
|
- name: Build
|
|
run: |
|
|
docker run \
|
|
-u $(id -u):$(id -g) \
|
|
-v ${GITHUB_WORKSPACE}/documentation:/docs \
|
|
squidfunk/mkdocs-material:3.0.4 build --clean --strict
|
|
|
|
- name: Provide Docs Metadata
|
|
run: |
|
|
mkdir -p documentation/docs-gen/misc
|
|
cp target/docuMetaData.json documentation/docs-gen/misc
|
|
|
|
- name: Deploy
|
|
if: github.ref == 'refs/heads/master'
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./documentation/docs-gen
|
|
user_name: 'github-actions[bot]'
|
|
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
|
|
keep_files: true
|
|
force_orphan: true
|