-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (75 loc) · 3.29 KB
/
master.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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build_deploy:
runs-on: ubuntu-latest
env:
TEST_BUCKET_NAME: ${{ secrets.TEST_BUCKET_NAME }}
TEST_KEY_OPTION_CSV: ${{ secrets.TEST_KEY_OPTION_CSV }}
TEST_KEY_FEAR_GREED_JSON: ${{ secrets.TEST_KEY_FEAR_GREED_JSON }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Set Timezone
uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "America/New_York"
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Install Dependencies
shell: bash
run: sudo apt-get update && sudo apt-get install -y -qq zip
# Step that does that actual cache save and restore
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Step that runs the tests
- name: Build with Maven and Generate Test Report
run: |
mvn clean install -Dmockserver.logLevel=OFF
mvn surefire-report:report-only
mvn site -DgenerateReports=false
zip -r test_results.zip ${{ github.workspace }}/target/site/
- name: Save Testing Report
uses: actions/upload-artifact@v2
if: success() || failure()
with:
name: test_results.zip
path: ${{ github.workspace }}/test_results.zip
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v10
if: ${{ github.event_name == 'push' }}
with:
# AWS Access Key
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS Secret Key
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS Region
region: us-east-1
# Beanstalk application name
application_name: StockDataService
# Beanstalk environment name. If empty a version will be created but not deployed anywhere.
environment_name: Stockdataservice-env
# Version label for new Beanstalk version
version_label: StockDataService-${{ github.run_id }}
# Version description for the new Beanstalk version
version_description: # optional
# Zip file with the version to deploy. If skipped the action will deploy existing version.
deployment_package: ${{ github.workspace }}/target/stockdataservice-0.0.1-SNAPSHOT.jar
# Whether the action should wait for the deployment to finish and log status messages during the wait. Default is "true". If set to "false" the action will start the deployment on Beanstalk and then exit.
wait_for_deployment: true
# How many seconds to wait for the environment to return to Green state after deployment is finished. Default is 30 seconds.
wait_for_environment_recovery: 1000
use_existing_version_if_available: true