Skip to content

Commit 4cc53cc

Browse files
authored
deploy javadoc via action
1 parent 7589bb4 commit 4cc53cc

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

.github/workflows/maven.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ on:
1515

1616
jobs:
1717
build:
18-
name: Build, Analyze & Deploy
18+
name: Build & Analyze
1919
runs-on: ubuntu-latest
2020

2121
permissions:
22-
contents: write # for GitHub Pages deployment
23-
pages: write
22+
contents: read
23+
pull-requests: write # for SonarQube PR comments
2424

2525
concurrency:
2626
group: ${{ github.workflow }}-${{ github.ref }}
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
java-version: 17
3838
distribution: 'temurin'
39-
cache: 'maven' # Enables built-in Maven dependency caching
39+
cache: 'maven'
4040

4141
- name: Cache SonarQube packages
4242
uses: actions/cache@v4
@@ -66,9 +66,31 @@ jobs:
6666
if-no-files-found: error
6767
retention-days: 90
6868

69-
- name: Deploy Javadocs to GitHub Pages
69+
- name: Upload Javadocs for deployment
7070
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
71-
uses: JamesIves/github-pages-deploy-action@v4
71+
uses: actions/upload-pages-artifact@v3
7272
with:
73-
branch: gh-pages
74-
folder: target/reports/apidocs
73+
path: target/reports/apidocs
74+
75+
deploy:
76+
name: Deploy to GitHub Pages
77+
needs: build
78+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
79+
runs-on: ubuntu-latest
80+
81+
permissions:
82+
pages: write
83+
id-token: write
84+
85+
environment:
86+
name: github-pages
87+
url: ${{ steps.deployment.outputs.page_url }}
88+
89+
concurrency:
90+
group: pages
91+
cancel-in-progress: false
92+
93+
steps:
94+
- name: Deploy to GitHub Pages
95+
id: deployment
96+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)