-
Notifications
You must be signed in to change notification settings - Fork 313
67 lines (60 loc) · 2.17 KB
/
updateDocs.yaml
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
name: Update Docs
on:
pull_request:
push:
branches:
- main
paths:
- 'docs/**'
release:
types: [published] # includes pre-release and regular releases, but does not include draft releases.
workflow_dispatch:
inputs:
committish:
description: Tag or branch of the docs to be created or updated. Using `main` will update the landing page. Using anything else will create or update a versioned copy of the docs.
required: true
default: main
jobs:
updateDocs:
runs-on: ubuntu-20.04
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d' --utc)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- run: |
git config user.name github-actions
git config user.email [email protected]
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- uses: actions/cache@v3
id: mvn-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.date }}
- name: Mvn install # Need this when the version/directory/pom structure changes
run: |
./mvnw \
--batch-mode \
--no-transfer-progress \
--show-version \
--threads 1.5C \
--define maven.test.skip=true \
--define maven.javadoc.skip=true \
install
- name: Remove SNAPSHOT # Needed for releases
run: |
if [[ -n "${{ github.event.release.tag_name }}" ]] ; then
./mvnw versions:set --batch-mode -DremoveSnapshot -DprocessAllModules
fi
- name: Update Docs
run: |
if [[ -n "${{ github.event.release.tag_name }}" ]] ; then
./docs/src/main/asciidoc/ghpages.sh --version ${{ github.event.release.tag_name }} --destination . --build
elif [[ -n "${{ github.event.inputs.committish }}" ]] && [[ "${{ github.event.inputs.committish }}" != "main" ]] ; then
./docs/src/main/asciidoc/ghpages.sh --version ${{ github.event.inputs.committish }} --destination . --build
else
./mvnw install -P docs -P '!CI' -pl docs -DskipTests # Simplified PR check
fi