-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (123 loc) · 3.77 KB
/
main.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Test, bygg, deploy
on:
push:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1'
jobs:
bygg:
name: Bygg
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
services:
postgres:
image: postgres:16.3
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 2345:5432
mock-oauth2-server:
image: ghcr.io/navikt/mock-oauth2-server:2.0.1
env:
JSON_CONFIG: >
{
"interactiveLogin": true,
"httpServer": "NettyWrapper",
"tokenCallbacks": [
{
"issuerId": "faketokenx",
"tokenExpiry": 600000,
"requestMappings": [
{
"requestParam": "acr",
"match": "Level4",
"claims": {
"sub": "42",
"aud": "someaudience",
"pid": "42",
"acr": "Level4"
}
},
{
"requestParam": "acr",
"match": "idporten-loa-high",
"claims": {
"sub": "42",
"aud": "someaudience",
"pid": "42",
"acr": "idporten-loa-high"
}
}
]
}
]
}
ports:
- 8118:8080
steps:
- uses: actions/checkout@v4
- run: PGPASSWORD=postgres psql -U postgres -h localhost -p 2345 -f ./local-db-init.sql
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
cache: maven
- run: mvn -B package
- uses: nais/docker-build-push@v0
id: gar-push
with:
team: fager
tag: ${{ github.sha }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
deploy-dev-gcp:
permissions:
contents: "read"
id-token: "write"
name: Deploy dev (dev-gcp)
needs: bygg
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/altinn_tilgangsoknader_take2'
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: nais/login@v0
id: login
with:
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
team: fager
- uses: nais/deploy/actions/deploy@v2
env:
VAR: image=${{ steps.login.outputs.registry }}/min-side-arbeidsgiver-api:${{ github.sha }}
RESOURCE: nais/dev-env.yaml
CLUSTER: dev-gcp
deploy-prod-gcp:
permissions:
contents: "read"
id-token: "write"
name: Deploy prod (prod-gcp)
needs: deploy-dev-gcp
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/altinn_tilgangsoknader_take2'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nais/login@v0
id: login
with:
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
team: fager
- uses: nais/deploy/actions/deploy@v2
env:
VAR: image=${{ steps.login.outputs.registry }}/min-side-arbeidsgiver-api:${{ github.sha }}
RESOURCE: nais/prod-env.yaml
CLUSTER: prod-gcp