Skip to content

Commit 89d6214

Browse files
committed
update ci config
1 parent b820567 commit 89d6214

1 file changed

Lines changed: 22 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
name: CI
1+
name: Java CI with Maven
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ "master" ]
66
pull_request:
7-
branches: [ master ]
8-
9-
permissions:
10-
contents: read
7+
branches: [ "master" ]
118

129
jobs:
1310
build:
@@ -17,27 +14,36 @@ jobs:
1714
- uses: actions/checkout@v4
1815

1916
- name: Set up JDK 17
20-
uses: actions/setup-java@v4
17+
uses: actions/setup-java@v3
2118
with:
22-
distribution: 'temurin'
2319
java-version: '17'
20+
distribution: 'temurin'
2421

25-
- name: Build with Maven
26-
run: mvn -B clean verify
27-
28-
- name: Generate Javadoc
29-
run: mvn javadoc:javadoc
22+
- name: Build and generate Javadoc
23+
run: mvn -B verify
3024

31-
- name: Upload Javadoc to GitHub Pages
32-
if: github.ref == 'refs/heads/master'
25+
- name: Copy Javadoc to temp folder
3326
run: |
3427
mkdir -p temp-docs
3528
cp -R target/site/apidocs/* temp-docs/
3629
30+
- name: Create redirect index.html
31+
run: |
32+
echo '<!DOCTYPE html>
33+
<html lang="en">
34+
<head>
35+
<meta http-equiv="refresh" content="0; url=overview-summary.html">
36+
<title>Redirecting…</title>
37+
</head>
38+
<body>
39+
<p>If you are not redirected automatically, follow this <a href="overview-summary.html">link</a>.</p>
40+
</body>
41+
</html>' > temp-docs/index.html
42+
3743
- name: Deploy to GitHub Pages
3844
uses: peaceiris/actions-gh-pages@v3
3945
with:
4046
github_token: ${{ secrets.GH_PAGES_TOKEN }}
4147
publish_dir: ./temp-docs
4248
publish_branch: gh-pages
43-
force_orphan: true
49+
force_orphan: true

0 commit comments

Comments
 (0)