-
Notifications
You must be signed in to change notification settings - Fork 3.1k
99 lines (82 loc) · 2.82 KB
/
build-main.yml
File metadata and controls
99 lines (82 loc) · 2.82 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
name: Build Main / Version Branch
on:
push:
branches:
- master
- 1.*
- 2.*
- 3.*
jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Build with Maven
run: ./mvnw -B --no-transfer-progress install -P coverage
- name: Upload surefire reports
if: always()
uses: actions/upload-artifact@v7
with:
name: surefire-reports
path: |
**/target/surefire-reports/*.xml
**/target/surefire-reports/*.txt
**/target/surefire-reports/*.dump*
**/target/surefire-reports/*.out
**/target/surefire-reports/*.err
if-no-files-found: warn
retention-days: 14
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
publish-snapshot:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded)
run: ./mvnw -B deploy --no-transfer-progress -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Maven project version for Asciidoc GitHub Pages directory naming
run: echo ::set-output name=version::$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
id: project
- name: Show extracted Maven project version
run: echo ${{ steps.project.outputs.version }}
- name: Build documentation with Maven
run: ./mvnw -B --no-transfer-progress site
- name: Deploy documentation to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
branch: gh-pages
folder: spring-boot-admin-docs/target/generated-docs/build
target-folder: ${{ steps.project.outputs.version }}
clean: true # Automatically remove deleted files from the deploy branch