-
Notifications
You must be signed in to change notification settings - Fork 1
108 lines (102 loc) · 3.89 KB
/
build-deploy.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
name: Build and deploy
run-name: Build and deploy || ${{ github.event.head_commit.message }}
on: [ push ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docker-build-push:
name: Build, test and push docker image
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
cache: maven
- name: Run tests
run: mvn test
- name: Build jar with Maven
run: mvn package -DskipTests
- uses: nais/docker-build-push@v0
id: docker-push
with:
team: teamia
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
salsa: false
outputs:
image: ${{ steps.docker-push.outputs.image }}
deploy-to-dev:
name: Deploy to dev-fss
needs: docker-build-push
if: github.ref == 'refs/heads/definer-næringskonsept'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
CLUSTER: dev-fss
IMAGE: ${{ needs.docker-build-push.outputs.image }}
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
RESOURCE: nais/dev.yaml
deploy-to-prod:
name: Deploy to prod-fss
needs: docker-build-push
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
CLUSTER: prod-fss
IMAGE: ${{ needs.docker-build-push.outputs.image }}
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
RESOURCE: nais/prod.yaml
deployTopicsToDev:
name: Deploy topics to dev
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/branch'
steps:
- uses: actions/checkout@v3
- name: Deploy topics to dev-fss
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: "\
nais/topics/topic-arbeidsgiver-sykefravaer-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-land-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-virksomhet-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-naring-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-sektor-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-bransje-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-metadata-virksomhet-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-naringskode-dev.yaml"
deployTopicsToProd:
name: Deploy topics to prod
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Deploy topics to prod-fss
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: "\
nais/topics/topic-arbeidsgiver-sykefravaer-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-land-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-virksomhet-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-naring-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-sektor-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-bransje-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-metadata-virksomhet-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-naringskode-prod.yaml"