-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (66 loc) · 2.2 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
72
73
74
75
76
77
78
name: Liiteri
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
permissions:
id-token: write
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Prepare clojure env
uses: ./.github/actions/prepare-clojure-env
- name: Run tests
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
GA_BUILD_NUMBER: ${{ github.run_number }}
run: |
git clone https://github.com/Opetushallitus/ci-tools.git
source ci-tools/common/setup-tools.sh
docker run --name liiteri-test-db -e POSTGRES_PASSWORD=oph -e POSTGRES_USER=oph -e POSTGRES_DB=liiteri -p 16433:5432 -d postgres:15
docker run --name liiteri-localstack -p 4566:4566 -d localstack/localstack:3.0.1
npm install
CONFIG=dev-resources/local-test-config.edn ./bin/cibuild.sh run-tests
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare clojure env
uses: ./.github/actions/prepare-clojure-env
- name: Build
run: CONFIG=dev-resources/local-test-config.edn ./bin/cibuild.sh create-uberjar
- uses: actions/cache@v4
id: restore-build
with:
path: target
key: ${{ github.sha }}
deploy:
needs: [ test, build ]
uses: Opetushallitus/.github/.github/workflows/push-scan-java-ecr.yml@main
with:
application: liiteri
base-image: baseimage-fatjar-openjdk21:master
configfolder: oph-configuration
jarfile: liiteri
jarfolder: target
secrets:
AWS_UTILITY_ROLE_ARN: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }}
deploy-background:
needs: [ test, build ]
uses: Opetushallitus/.github/.github/workflows/push-scan-java-ecr.yml@main
with:
application: liiteri-background
base-image: baseimage-fatjar-openjdk21:master
configfolder: oph-configuration
jarfile: liiteri
jarfolder: target
secrets:
AWS_UTILITY_ROLE_ARN: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }}