-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.95 KB
/
Copy pathpublish-docs.yml
File metadata and controls
58 lines (52 loc) · 1.95 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
name: Build and Deploy Maven Site to GitHub Pages
on:
workflow_dispatch:
workflow_run:
workflows: ["Build any branch"]
types: [completed]
branches: [ main ]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
env:
MAVEN_COMMAND: ./mvnw
MAVEN_CLI_COMMON: "-e -B"
jobs:
build-site:
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
ref: ${{ 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 install
# Only the integration module has site content (src/site); its <distributionManagement><site>
# url is the Pages root, so it is the published site. Build just that module (the same command
# building.adoc documents for local use). The archetype module has no site and no
# distributionManagement, which is what broke the previous reactor-wide `site site:stage`.
- name: Generate Maven site (integration module)
run: ${{ env.MAVEN_COMMAND }} ${{ env.MAVEN_CLI_COMMON }} site -pl integration -Dproject.build.outputTimestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: integration/target/site/
deploy:
needs: build-site
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5