-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (57 loc) · 1.77 KB
/
build.yml
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
name: Build
on:
push:
branches: [master]
paths-ignore: ["**.md"]
pull_request:
branches: [master]
paths-ignore: ["**.md"]
create:
tags:
- '*'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- 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
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
- name: Gradle Build
run: ./gradlew build
- name: Save test results artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: test-report
path: build/reports/tests/test
- name: Upload coverage to codecov.io
if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Gradle Local Docker Trial Build
if: ${{ !endsWith(github.ref, '/master') && !startsWith(github.ref, 'refs/tags/') }}
run: ./gradlew jibDockerBuild -x check
- name: Gradle Official Docker Build & Push
if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }}
run: ./gradlew jibGitHubContainerRegistry -x check