-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.25 KB
/
gradle.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
name: CI Build
on:
push:
branches:
- "**"
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
distribution: [ 'temurin' ]
java: [ '17' ]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Java 17
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- if: ${{ github.ref == 'refs/heads/main' }}
name: SonarQube Scan
run: ./gradlew sonarqube
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- if: ${{ github.ref == 'refs/heads/main' }}
name: Build and Publish Docker Image
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
./gradlew bootBuildImage --imageName=${{ secrets.DOCKER_USERNAME }}/mfscreener
docker push ${{ secrets.DOCKER_USERNAME }}/mfscreener