-
Notifications
You must be signed in to change notification settings - Fork 4
80 lines (69 loc) · 2.17 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
69
70
71
72
73
74
75
76
77
78
79
80
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: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Gradle Build, Lint, Test
uses: gradle/gradle-build-action@v2
with:
arguments: build
gradle-home-cache-cleanup: true
- name: Save test results artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: test-report
path: build/reports/tests/test
- name: Upload coverage to codecov.io
uses: codecov/[email protected]
- name: Gradle Local Docker Trial Build
uses: gradle/gradle-build-action@v2
if: ${{ !endsWith(github.ref, '/master') && !startsWith(github.ref, 'refs/tags/') }}
env:
JAVA_HOME: ${{ env.JAVA_HOME }}
with:
arguments: 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: Login to Docker Hub Container Registry
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ vars.DOCKER_HUB_ID }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }}
name: Gradle Official Docker Build & Push
uses: gradle/gradle-build-action@v2
env:
JAVA_HOME: ${{ env.JAVA_HOME }}
with:
arguments: jibGitHubContainerRegistry jibDockerHub -x check