-
Notifications
You must be signed in to change notification settings - Fork 2
168 lines (134 loc) · 3.55 KB
/
documentation.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: documentation
on:
push:
branches:
- main
release:
types:
- published
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build-gradle-javadoc:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Set up JDK 1.11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'corretto'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Generate javadoc
run: |
./gradlew javadoc
rm docs/javadoc/*.zip
- name: Upload Gradle javadoc artifact
uses: actions/upload-artifact@v4
with:
name: gradle-javadoc
path: docs/javadoc
build-jekyll-site:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
cache-version: 0
working-directory: '${{ github.workspace }}/docs'
- name: Build with Jekyll
run: bundle exec jekyll build
env:
JEKYLL_ENV: production
- name: Upload Jekyll site artifact
uses: actions/upload-artifact@v4
with:
name: jekyll-site
path: docs/_site
deploy-github-pages:
runs-on: ubuntu-latest
needs: [build-gradle-javadoc, build-jekyll-site]
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Download Gradle javadoc artifact
uses: actions/download-artifact@v4
with:
name: gradle-javadoc
path: pages/javadoc
- name: Download Jekyll site artifact
uses: actions/download-artifact@v4
with:
name: jekyll-site
path: pages/
- name: Publish docs
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: pages/
clean-exclude: |
badges
coverage
update-documentation-badges:
if: ${{ always() && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs: deploy-github-pages
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Generate license badge
uses: knightdave/[email protected]
with:
file: docs/badges/license.svg
label: license
value: BSD-3-Clause
color: yellowgreen
template: docs/badges/template.svg
overwrite: true
- name: Get build result
run: |
if [[ ${{ needs.deploy-github-pages.result }} == "success" ]]; then
exit 0
else
exit 1
fi
- name: Generate passing badge
if: success()
uses: knightdave/[email protected]
with:
file: docs/badges/documentation.svg
label: docs
value: passing
color: green
template: docs/badges/template.svg
overwrite: true
- name: Generate failing badge
if: failure()
uses: knightdave/[email protected]
with:
file: docs/badges/documentation.svg
label: docs
value: failing
color: red
template: docs/badges/template.svg
overwrite: true
- name: Publish badge
if: success() || failure()
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/badges
target-folder: badges
clean: false