github.com/jaylevin/jenkins-library@v1.230.4/.github/workflows/documentation.yaml (about) 1 name: Documentation 2 3 on: 4 push: 5 branches: 6 - master 7 pull_request: 8 branches: 9 - master 10 11 jobs: 12 Build: 13 runs-on: ubuntu-latest 14 steps: 15 16 - uses: actions/checkout@v2 17 18 - uses: actions/setup-java@v1 19 with: 20 java-version: '1.8' 21 22 - uses: actions/setup-go@v1 23 with: 24 go-version: '1.18.x' 25 26 - name: Install Groovy 27 run: sudo apt-get update && sudo apt-get install groovy -y 28 29 - name: Cache Maven Packages 30 uses: actions/cache@v1 31 with: 32 path: ~/.m2/repository 33 key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} 34 restore-keys: | 35 ${{ runner.os }}-maven- 36 37 - name: Cache Go Packages 38 uses: actions/cache@v1 39 with: 40 path: ~/go/pkg/mod 41 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 42 restore-keys: | 43 ${{ runner.os }}-go- 44 45 - run: docker pull ppiper/jenkinsfile-runner:latest 46 47 - name: Generate Groovy Docs 48 env: 49 MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn 50 run: documentation/bin/createDocu.sh 51 52 - name: Generate Golang Docs 53 run: go run pkg/documentation/generator.go --docuDir=documentation/docs/steps/ --customDefaultFile resources/default_pipeline_environment.yml 54 55 - run: docker pull squidfunk/mkdocs-material:3.0.4 56 57 - name: Build 58 run: | 59 docker run \ 60 -u $(id -u):$(id -g) \ 61 -v ${GITHUB_WORKSPACE}/documentation:/docs \ 62 squidfunk/mkdocs-material:latest build --clean --strict 63 64 - name: Provide Docs Metadata 65 run: | 66 mkdir -p documentation/docs-gen/misc 67 cp target/docuMetaData.json documentation/docs-gen/misc 68 69 - name: Deploy 70 if: github.ref == 'refs/heads/master' 71 uses: peaceiris/actions-gh-pages@v3 72 with: 73 github_token: ${{ secrets.GITHUB_TOKEN }} 74 publish_dir: ./documentation/docs-gen 75 user_name: 'github-actions[bot]' 76 user_email: '41898282+github-actions[bot]@users.noreply.github.com' 77 keep_files: true 78 force_orphan: true