-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (139 loc) · 4.82 KB
/
build.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: "Bygg og deploy"
on:
push:
branches:
- '**'
paths-ignore:
- '**.md'
- '**.MD'
- '.gitignore'
- 'LICENSE'
- 'CODEOWNERS'
- '.github/*.yml'
jobs:
build-app:
name: Build
permissions:
contents: read
packages: write
id-token: write
uses: navikt/sif-gha-workflows/.github/workflows/maven-build-app-db.yml@main
with:
java-version: 21
build-image: ${{ github.actor != 'dependabot[bot]' }}
push-image: ${{ github.ref_name == github.event.repository.default_branch}}
upload-image: ${{ github.ref_name != github.event.repository.default_branch }}
db_schema: ung_sak_unit
pg_version: 16
secrets: inherit
build-typescript-client:
name: Build typescript client
runs-on: ubuntu-latest
needs: build-app
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: navikt/sif-gha-workflows/.github/actions/maven/generate-openapi@main
id: generate-openapi
with:
readerToken: ${{ secrets.READER_TOKEN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
openapiFileName: ung-sak.openapi.json
- uses: ./.github/actions/generate-typescript-client
id: generate-typescript
with:
openapiVersion: ${{ steps.generate-openapi.outputs.openapiVersion }}
patchVersion: ${{ needs.build-app.outputs.build-version }}
# Upload generated typescript package, so it can be downloaded and published by later job
- uses: actions/upload-artifact@v4
id: upload-typescript
with:
name: ung-sak-typescript-client-src
path: "${{ steps.generate-typescript.outputs.resultDir }}"
if-no-files-found: error
verdikjede-tester:
name: Verdikjedetester
secrets: inherit
permissions:
id-token: write
contents: read
packages: read
uses: navikt/sif-gha-workflows/.github/workflows/verdikjede-test-v2.yml@main
if: ${{github.actor != 'dependabot[bot]'}}
needs: build-app
with:
tag: ${{ needs.build-app.outputs.build-version }}
suites: "ung"
override_image_artifact_name: ${{ github.ref_name != github.event.repository.default_branch && needs.build-app.outputs.image-artifact-name || null }}
image_version: ${{ needs.build-app.outputs.build-version }}
deploy-dev:
name: Deploy dev
permissions:
id-token: write
contents: write
if: github.ref_name == 'master'
needs: [build-app]
uses: navikt/sif-gha-workflows/.github/workflows/maven-deploy.yml@main
with:
gar: true
image: ${{ needs.build-app.outputs.build-version }}
cluster: dev-gcp
naiserator_file: deploy/dev-gcp.yml
secrets: inherit
check-change-compat-typescript-client:
name: Change and compatibility check typescript client
runs-on: ubuntu-latest
needs: [build-typescript-client, deploy-dev]
outputs:
hasChanged: ${{ steps.compare-with-published.outputs.hasChanged }}
permissions:
contents: read
packages: read
steps:
- uses: actions/download-artifact@v4
with:
name: ung-sak-typescript-client-src
path: /tmp/ung-sak-typescript-client
- uses: navikt/openapi-ts-clientmaker/extra/actions/compare-with-published@v1
id: compare-with-published
with:
localPath: /tmp/ung-sak-typescript-client
npmPackageName: ung-sak-typescript-client
githubToken: ${{ secrets.GITHUB_TOKEN }}
- uses: navikt/k9-sak-web/.github/actions/check-compat-typescript-client@master
if: steps.compare-with-published.outputs.hasChanged == 'true'
with:
readerToken: ${{ secrets.READER_TOKEN }}
newClientPath: /tmp/ung-sak-typescript-client
publish-typescript-client:
name: Publish typescript client
runs-on: ubuntu-latest
needs: [check-change-compat-typescript-client]
if: needs.check-change-compat-typescript-client.outputs.hasChanged == 'true'
permissions:
contents: read
packages: write
steps:
- uses: actions/download-artifact@v4
with:
name: ung-sak-typescript-client-src
path: /tmp/ung-sak-typescript-client
- uses: navikt/openapi-ts-clientmaker/extra/actions/publish-typescript-client@v1
with:
contentPath: /tmp/ung-sak-typescript-client
githubToken: ${{ secrets.GITHUB_TOKEN }}
# deploy-prod:
# name: Deploy prod
# permissions:
# id-token: write
# contents: write
# if: github.ref_name == 'master'
# needs: [build-app, verdikjede-tester, deploy-dev]
# uses: navikt/sif-gha-workflows/.github/workflows/maven-deploy.yml@main
# with:
# gar: true
# image: ${{ needs.build-app.outputs.build-version }}
# cluster: prod-gcp
# naiserator_file: deploy/prod-gcp.yml
# secrets: inherit