-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Gradle Github actions as currently recommended
- Loading branch information
1 parent
f0c2dea
commit 0d47336
Showing
1 changed file
with
17 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,15 @@ jobs: | |
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Login to GitHub Container Registry | ||
if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
@@ -31,12 +38,13 @@ jobs: | |
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Gradle Build, Lint, Test | ||
uses: gradle/actions/setup-gradle@v3 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
arguments: build | ||
gradle-home-cache-cleanup: true | ||
|
||
- name: Gradle Build | ||
run: ./gradlew build | ||
|
||
- name: Save test results artifact | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -48,23 +56,9 @@ jobs: | |
uses: codecov/[email protected] | ||
|
||
- name: Gradle Local Docker Trial Build | ||
uses: gradle/actions/setup-gradle@v3 | ||
if: ${{ !endsWith(github.ref, '/master') && !startsWith(github.ref, 'refs/tags/') }} | ||
env: | ||
JAVA_HOME: ${{ env.JAVA_HOME }} | ||
with: | ||
arguments: jibDockerBuild -x check | ||
run: ./gradlew jibDockerBuild -x check | ||
|
||
- if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }} | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }} | ||
name: Gradle Official Docker Build & Push | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
arguments: jibGitHubContainerRegistry -x check | ||
- name: Gradle Official Docker Build & Push | ||
if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }} | ||
run: ./gradlew jibGitHubContainerRegistry -x check |