-
Notifications
You must be signed in to change notification settings - Fork 6
71 lines (60 loc) · 1.7 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
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
name: Omatsivut
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
permissions:
id-token: write
contents: read
jobs:
test-and-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
- uses: actions/setup-node@v3
with:
node-version: 8
- uses: szenius/set-timezone@v1.2
with:
timezoneLinux: "Europe/Helsinki"
- name: Build PostgreSQL Docker containers
run: |
cd postgresql/docker/
docker build --tag omatsivut-postgres .
docker build --tag valintarekisteri-postgres .
cd -
- name: Build with Maven
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
run: |
./cibuild.bash
- uses: actions/cache@v4
id: restore-build
with:
path: |
target
key: ${{ github.sha }}
deploy-container:
needs: test-and-build
uses: Opetushallitus/.github/.github/workflows/push-scan-java-ecr.yml@main
with:
application: omatsivut
base-image: baseimage-fatjar-openjdk17:master
configfolder: src/main/resources/oph-configuration
jarfile: omatsivut*SNAPSHOT-allinone
secrets:
AWS_UTILITY_ROLE_ARN: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }}