-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (40 loc) · 1.23 KB
/
aws-dynamo-main.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: aws-dynamodb-project
on:
push:
paths:
- "aws-dynamodb-project/**"
branches: [main]
pull_request:
paths:
- "aws-dynamodb-project/**"
types:
- opened
- synchronize
- reopened
jobs:
build:
name: Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: "aws-dynamodb-project"
strategy:
matrix:
distribution: [ 'temurin' ]
java: [ '17' ]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
cache: 'maven'
- name: Build with Maven
run: ./mvnw clean verify
- if: ${{ github.ref == 'refs/heads/main' }}
name: Build and Publish Docker Image
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=${{ secrets.DOCKER_USERNAME }}/aws-dynamodb-project-${{ matrix.java }}
docker push ${{ secrets.DOCKER_USERNAME }}/aws-dynamodb-project-${{ matrix.java }}