-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (65 loc) · 2.15 KB
/
Copy pathpublish-docs.yml
File metadata and controls
71 lines (65 loc) · 2.15 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
66
67
68
69
70
71
name: Build and Deploy Maven Site to GitHub Pages
on:
workflow_dispatch:
push:
branches: [main]
paths:
- '**/src/site/**'
- '**/*.adoc'
- '**/*.md'
workflow_run:
workflows: ["Build any branch"]
types: [completed]
branches: [ main ]
permissions:
contents: read
concurrency:
group: pages
cancel-in-progress: false
env:
MAVEN_COMMAND: ./mvnw
MAVEN_CLI_COMMON: "-e -B"
jobs:
build-site:
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}
- uses: ./.github/actions/jdk-setup
# Tests run (no -DskipTests) so JaCoCo writes target/jacoco.exec and target/jacoco-it.exec;
# the site step renders the unit and integration coverage reports from them.
- name: Build project (runs tests for coverage data)
run: ${{ env.MAVEN_COMMAND }} ${{ env.MAVEN_CLI_COMMON }} clean verify
# site:stage assembles the per-module sites of this multi-module build into
# target/staging/, using the <distributionManagement><site> urls in the poms.
- name: Generate and stage Maven site
run: ${{ env.MAVEN_COMMAND }} ${{ env.MAVEN_CLI_COMMON }} site site:stage -Dproject.build.outputTimestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
- name: Upload Pages artifact
if: >-
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
github.event_name == 'workflow_run'
uses: actions/upload-pages-artifact@v5
with:
path: target/staging/
deploy:
needs: build-site
if: >-
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
github.event_name == 'workflow_run'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5