-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (55 loc) · 1.75 KB
/
build-and-deploy.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
name: Build and Deploy
on:
push:
branches:
- development
- test
- master
jobs:
build-and-deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 15
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '15'
- name: Cache maven artifacts
uses: actions/cache@v4
env:
cache-name: cache-maven-artifacts
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.m2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Install AWS CLI
run: pip install awscli
- name: Install jq for commandline json parsing
run: sudo apt-get -y install jq --allow-unauthenticated
- name: Extract branch name
shell: bash
run: echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Build with Maven
run: ./deploy/build.sh unused ${{ env.BRANCH }}
env:
MDM_ENDPOINT: ${{ secrets.MDM_ENDPOINT }}
MDM_TASK_PASSWORD: ${{ secrets.MDM_TASK_PASSWORD }}
MDM_TASK_USER: ${{ secrets.MDM_TASK_USER }}
- name: Deploy to AWS
run: ./deploy/deploy.sh unused ${{ env.BRANCH }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Report Code Coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Report build status via Slack
uses: act10ns/slack@v2
if: always()
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}