-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.63 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build and generate docs
on:
push:
branches-ignore:
- docs
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [1.8, 11, 17] # We're building on all Java 8+ LTS versions
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-package: jdk
java-version: ${{ matrix.java }}
- name: Make Gradle executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x gradlew
- name: Test using Gradle
run: ./gradlew test
- name: Build using Gradle
run: ./gradlew build
- name: Build the multi-module documentation using Gradle
if: ${{ github.event_name == 'push' && runner.os == 'Linux' && matrix.java == '1.8' }} # Only deploy docs once
run: ./gradlew dokkaHtmlMultiModule
- name: Extract branch name
id: extract_branch
if: ${{ github.event_name == 'push' && runner.os == 'Linux' && matrix.java == '1.8' }} # Only deploy docs once
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Deploy documentation
if: ${{ github.event_name == 'push' && runner.os == 'Linux' && matrix.java == '1.8' }} # Only deploy docs once
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/dokka/htmlMultiModule
publish_branch: docs/${{ steps.extract_branch.outputs.branch }}
force_orphan: true