Skip to content

Commit b8aade3

Browse files
committed
wip
1 parent b2010c7 commit b8aade3

File tree

4 files changed

+139
-11
lines changed

4 files changed

+139
-11
lines changed

.github/workflows/build-and-deploy.yaml

+76-9
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,83 @@ name: Build & Deploy
22
on:
33
push:
44
workflow_dispatch:
5-
5+
permissions:
6+
actions: read
7+
contents: write
8+
security-events: write
9+
packages: write
10+
id-token: write
611
jobs:
7-
jar-app:
8-
uses: navikt/teamesyfo-github-actions-workflows/.github/workflows/jar-app.yaml@main
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: github/codeql-action/init@v3
20+
with:
21+
languages: kotlin
22+
- uses: navikt/teamesyfo-github-actions-workflows/actions/gradle-cached@main
23+
- run: ./gradlew shadowJar -x test
24+
env:
25+
ORG_GRADLE_PROJECT_githubUser: x-access-token
26+
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
27+
- uses: github/codeql-action/analyze@v3
28+
with:
29+
category: "/language:kotlin"
30+
31+
test:
32+
name: Test
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: navikt/teamesyfo-github-actions-workflows/actions/gradle-cached@main
36+
- run: ./gradlew test
37+
env:
38+
ORG_GRADLE_PROJECT_githubUser: x-access-token
39+
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
40+
41+
build:
42+
name: Build
43+
runs-on: ubuntu-latest
944
permissions:
10-
actions: read
11-
contents: write
12-
security-events: write
1345
packages: write
46+
contents: write
1447
id-token: write
15-
secrets: inherit
16-
with:
17-
app: esyfovarsel
48+
outputs:
49+
image: ${{ steps.build-and-publish.outputs.image }}
50+
steps:
51+
- uses: navikt/teamesyfo-github-actions-workflows/actions/jar-to-docker@main
52+
id: build-and-publish
53+
with:
54+
app: ${{ inputs.app }}
55+
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
56+
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
57+
github_token: ${{ secrets.GITHUB_TOKEN }}
58+
59+
deploy-dev:
60+
if: ${{ github.actor != 'dependabot[bot]' && github.ref_name == 'esyfo'}}
61+
name: Deploy to dev
62+
runs-on: ubuntu-latest
63+
needs: [test, build]
64+
steps:
65+
- uses: actions/checkout@v4
66+
- uses: nais/deploy/actions/deploy@v2
67+
env:
68+
CLUSTER: dev-gcp
69+
RESOURCE: nais/nais-dev.yaml
70+
VAR: image=${{ needs.build.outputs.image }}
71+
72+
deploy-prod:
73+
if: github.ref_name == 'esyfo'
74+
name: Deploy to prod
75+
runs-on: ubuntu-latest
76+
needs: [test, build]
77+
steps:
78+
- uses: actions/checkout@v4
79+
- uses: nais/deploy/actions/deploy@v2
80+
env:
81+
CLUSTER: prod-gcp
82+
RESOURCE: nais/nais-prod.yaml
83+
VAR: image=${{ needs.build.outputs.image }}
84+

.github/workflows/topic.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Deploy topic"
2+
on:
3+
push:
4+
paths:
5+
- nais/topics/**
6+
- .github/workflows/topic.yaml
7+
jobs:
8+
deploy-topic-to-dev:
9+
if: github.ref == 'refs/heads/esyfo'
10+
name: Deploy topic to dev
11+
permissions:
12+
id-token: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Deploy topic varselbus to dev
18+
uses: nais/deploy/actions/deploy@v2
19+
env:
20+
CLUSTER: dev-gcp
21+
RESOURCE: nais/topics/dinesykmeldte-lest-topic.yaml
22+
VAR: kafka-pool=nav-dev
23+
24+
deploy-topic-to-prod:
25+
if: github.ref == 'refs/heads/esyfo'
26+
name: Deploy topic to prod
27+
permissions:
28+
id-token: write
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
- name: Deploy topic varselbus to prod
34+
uses: nais/deploy/actions/deploy@v2
35+
env:
36+
CLUSTER: prod-gcp
37+
RESOURCE: nais/topics/dinesykmeldte-lest-topic.yaml
38+
VAR: kafka-pool=nav-prod

naiserator-prod.yaml nais/nais-prod.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ apiVersion: "nais.io/v1alpha1"
22
kind: "Application"
33
metadata:
44
name: dinesykmeldte-backend
5-
namespace: teamsykmelding
5+
namespace: team-esyfo
66
labels:
7-
team: teamsykmelding
7+
team: team-esyfo
88
spec:
99
image: {{ image }}
1010
gcp:
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: kafka.nais.io/v1
2+
kind: Topic
3+
metadata:
4+
name: dinesykmeldte-lest-topic
5+
namespace: team-esyfo
6+
labels:
7+
team: team-esyfo
8+
spec:
9+
pool: {{ kafka_pool }}
10+
config:
11+
cleanupPolicy: delete
12+
minimumInSyncReplicas: 2
13+
partitions: 3
14+
replication: 3
15+
retentionBytes: -1 # Messages will never be deleted because of disk space
16+
retentionHours: -1 # Messages will never be timed out
17+
acl:
18+
- team: team-esyfo
19+
application: dinesykmeldte-backend
20+
access: readwrite
21+
- team: teamsykmelding
22+
application: dinesykmeldte-backend
23+
access: readwrite

0 commit comments

Comments
 (0)