Skip to content

Commit 7aa651d

Browse files
CI: publish Javadoc on push with build success
1 parent a2d4ae8 commit 7aa651d

2 files changed

Lines changed: 9 additions & 26 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
51
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
62
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
73

8-
name: Java CI with Gradle
4+
name: Gradle Build
95

106
on:
117
push:
@@ -36,17 +32,6 @@ jobs:
3632
- name: Build with Gradle Wrapper
3733
run: ./gradlew build
3834

39-
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
40-
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
41-
#
42-
# - name: Setup Gradle
43-
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
44-
# with:
45-
# gradle-version: '8.9'
46-
#
47-
# - name: Build with Gradle 8.9
48-
# run: gradle build
49-
5035
dependency-submission:
5136

5237
runs-on: ubuntu-latest
@@ -60,8 +45,3 @@ jobs:
6045
with:
6146
java-version: '17'
6247
distribution: 'temurin'
63-
64-
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
65-
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
66-
# - name: Generate and submit dependency graph
67-
# uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

.github/workflows/publish-javadoc.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
name: Publish Javadoc
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_run:
5+
workflows: [ "Gradle Build" ]
6+
branches: [ "main" ]
7+
types:
8+
- completed
79

810
jobs:
911
publish:
1012
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
1114
permissions:
12-
contents: write # if you have a protection rule on your repository, you'll need to give write permission to the workflow.
15+
contents: write
1316
steps:
14-
- name: Deploy JavaDoc
17+
- name: Publish JavaDoc
1518
uses: MathieuSoysal/Javadoc-publisher.yml@v3.0.2
1619
with:
1720
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)