-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (65 loc) · 1.81 KB
/
deployGhPages.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
name: Deploy GitHub Pages
env:
gh_pages_index_prefix: |
<html>
<head>
<title>ICGE Documentation</title>
</head>
<body>
<h1>ICGE Documentation</h1>
<p> This is the documentation for the ICGE.</p>
<p> If you are looking for the code, see <a href="https://github.com/fius/icge2">github.com/fius/icge2</a></p>
<h2>Contents</h2>
<ul>
gh_pages_index_suffix: |
</ul>
</body>
</html>
on:
push:
branches: [ master ]
tags: [ '**' ]
release:
types: [ published, edited ]
workflow_dispatch: {}
jobs:
generate_javadoc:
name: Generate Javadoc
runs-on: ubuntu-latest
steps:
- name: Calculate ref
run: echo "REF_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/checkout@v2
- name: Generate javadoc
run: ./mvnw -B javadoc:aggregate -pl '!ICGE-build-tools,!ICGE-ManualStart'
- name: Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/site/apidocs/
destination_dir: ./${{ env.REF_NAME }}
generate_index:
name: Generate Index
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: gh-pages
- name: Generate index
run: |
#!/usr/bin/env bash
echo "$gh_pages_index_prefix" > index.html
for path in * ;do
if [ -d $path ] ;then
echo '<li><a href="'"$path"'">'"$path"'</a></li>' >> index.html
fi
done
echo "$gh_pages_index_suffix" >> index.html
- name: Commit index
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update index