-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.18 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
name: Build and publish
on:
push:
branches: main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'liberica'
cache: 'maven'
- name: Package with Maven
run: mvn package -B -P prod "-Dstyle.color=always"
# - name: Bump version and sync git
# id: bump
# uses: mickem/gh-action-bump-maven-version@v1.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: g0tn/soat-tech-challenge-backend:$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout),g0tn/soat-tech-challenge-backend:latest
cache-from: type=gha
cache-to: type=gha,mode=max