-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (62 loc) · 2.53 KB
/
maven-documentation.yml
File metadata and controls
65 lines (62 loc) · 2.53 KB
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
name: Publish Documentation
on:
release:
types: [published, created, edited]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
###############################################################
# Checkout main repo
###############################################################
- name: Check out main repo
uses: actions/checkout@v2
with:
fetch-depth: 0
###############################################################
# Lookup the previous tag
###############################################################
- name: Get previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
###############################################################
# Checkout repo from previous tag
###############################################################
- uses: actions/checkout@v2
with:
ref: ${{ steps.previoustag.outputs.tag }}
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
server-id: jd-oss-github # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
settings-path: ${{ github.workspace }} # location for the settings.xml file
env:
MAVEN_USERNAME: ${{ secrets.JD_OSS_MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.JD_OSS_MAVEN_PASSWORD }}
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
###############################################################
# Generate JavaDocs via maven
###############################################################
- name: Generate JavaDocs
run: mvn -B site --file pom.xml -s ${{ github.workspace }}/settings.xml
env:
MAVEN_USERNAME: ${{ secrets.JD_OSS_MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.JD_OSS_MAVEN_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
###############################################################
# Publish generated JavaDocs to Github Pages
###############################################################
- name: Publish JavaDocs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/site/apidocs