-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.34 KB
/
maven.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: Java CI with Maven
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Unit Tests # runs the unit tests
run: mvn -B test --file pom.xml # runs the maven command to run the unit tests
- name: Build # builds the project
run: |
mvn clean
mvn -B package --file pom.xml
- name: Create Timestamp for version info
id: time
uses: nanzm/get-time-action@master
with:
format: 'YYYY-MM-DD-HH-mm-ss'
- name: Make Artifact Available
uses: actions/upload-artifact@v2
with:
name: "Artifact-${{steps.time.outputs.time}}"
path: build/libs
retention-days: 5
- name: Deploy to AWS Beanstalk
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{secrets.AWS_ACCESS_KEY_ID}}
aws_secret_key: ${{secrets.AWS_SECRET_KEY_ID}}
application_name: imageuploaderapi
environment_name: Imageuploaderapi-env-1
version_label: imageuploaderapi-${{steps.time.outputs.time}}
region: us-east-1
deployment_package: target/image-uploder-0.0.1-SNAPSHOT.jar