forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (120 loc) · 4.48 KB
/
doc-build.yml
File metadata and controls
129 lines (120 loc) · 4.48 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Quarkus Documentation CI
permissions:
contents: read
actions: write
on:
push:
branches-ignore:
- 'dependabot/**'
- '3.0'
paths:
- 'core/processor/**'
- 'devtools/config-doc-maven-plugin/**'
- 'docs/**'
- 'extensions/**/pom.xml'
- 'extensions/**/*Config*.java'
- 'extensions/core/runtime/pom.xml'
- 'extensions/core/runtime/**/*Config*.java'
- 'extensions/core/deployment/pom.xml'
- 'extensions/core/deployment/**/*Config*.java'
- 'test-framework/jacoco/**/pom.xml'
- 'test-framework/jacoco/**/*Config*.java'
- '.github/workflows/doc-build.yml'
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'core/processor/**'
- 'devtools/config-doc-maven-plugin/**'
- 'docs/**'
- 'extensions/**/pom.xml'
- 'extensions/**/*Config*.java'
- 'extensions/core/runtime/pom.xml'
- 'extensions/core/runtime/**/*Config*.java'
- 'extensions/core/deployment/pom.xml'
- 'extensions/core/deployment/**/*Config*.java'
- 'test-framework/jacoco/**/pom.xml'
- 'test-framework/jacoco/**/*Config*.java'
- '.github/workflows/doc-build.yml'
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'quarkusio/quarkus' }}
env:
MVNW_REPOURL: https://maven-central.storage-download.googleapis.com/maven2
jobs:
ci-sanity-check:
name: "CI Sanity Check"
runs-on: ubuntu-latest
steps:
- name: Build
run: sleep 30
build-doc:
name: "Documentation Build"
timeout-minutes: 60
runs-on: ubuntu-latest
# Skip main in forks
if: github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main')
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: 17
- name: Generate cache key
id: cache-key
run: |
CURRENT_BRANCH="${{ github.repository != 'quarkusio/quarkus' && 'fork' || github.base_ref || github.ref_name }}"
CURRENT_MONTH=$(/bin/date -u "+%Y-%m")
CURRENT_DAY=$(/bin/date -u "+%d")
ROOT_CACHE_KEY="m2-cache"
echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
echo "m2-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
echo "m2-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
- name: Restore Maven Repository
uses: actions/cache/restore@v5
with:
path: ~/.m2/repository
key: ${{ steps.cache-key.outputs.m2-cache-key }}
restore-keys: |
${{ steps.cache-key.outputs.m2-monthly-branch-cache-key }}-
${{ steps.cache-key.outputs.m2-monthly-cache-key }}-
- name: Build
run: |
./mvnw -DquicklyDocs -B --settings .github/mvn-settings.xml
- name: Build Docs
run: |
if ./mvnw -e -B --settings .github/mvn-settings.xml clean package -pl docs -Dasciidoctor.fail-if=DEBUG ; then
echo "Build ok"
else
if [ -f docs/target/metadataErrors.md ]; then
echo "### Document Metadata Errors" >> $GITHUB_STEP_SUMMARY
cat docs/target/metadataErrors.md >> $GITHUB_STEP_SUMMARY
fi
exit 1
fi
- name: Store PR id
run: echo ${{ github.event.number }} > pr-id.txt
- name: Persist documentation
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: documentation
path: |
pr-id.txt
docs/
target/asciidoc/generated/config/
retention-days: 1
- name: Prepare build reports archive
if: always()
run: |
7z a -tzip build-reports.zip -r \
'**/target/*-reports/TEST-*.xml' \
'target/build-report.json' \
LICENSE
- name: Upload build reports
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: "build-reports-${{ github.run_attempt }}-Documentation Build"
path: |
build-reports.zip
retention-days: 7