Skip to content

Commit cd82de2

Browse files
authored
Merge pull request #2183 from navikt/automatic-release
automatic release
2 parents 7f547a3 + bfb04b3 commit cd82de2

11 files changed

+477
-459
lines changed

.github/workflows/build-and-test.yml

+22-23
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
name: Build and test
2-
32
on:
4-
push:
3+
push:
54

65
jobs:
7-
build:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Checkout repo
11-
uses: actions/checkout@v3
12-
- name: Setup node.js
13-
uses: actions/setup-node@v3
14-
with:
15-
node-version: '20'
16-
registry-url: 'https://npm.pkg.github.com'
17-
cache: 'npm'
18-
- name: Install dependencies
19-
run: npm ci --ignore-scripts
20-
env:
21-
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
22-
- name: Run linting
23-
run: npm run lint
24-
- name: Build application
25-
run: npm run build-local
26-
- name: Run tests
27-
run: npm run test
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repo
10+
uses: actions/checkout@v3
11+
- name: Setup node.js
12+
uses: actions/setup-node@v3
13+
with:
14+
node-version: 20
15+
registry-url: 'https://npm.pkg.github.com'
16+
cache: 'npm'
17+
- name: Install dependencies
18+
run: npm ci --ignore-scripts
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
21+
- name: Run linting
22+
run: npm run lint
23+
- name: Build application
24+
run: npm run build-local
25+
- name: Run tests
26+
run: npm run test

.github/workflows/build-image.yml

+132-132
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,136 @@
11
name: Build docker image
22
on:
3-
workflow_call:
4-
inputs:
5-
environment:
6-
required: true
7-
type: string
8-
imagename:
9-
required: true
10-
type: string
11-
ENV:
12-
required: true
13-
type: string
14-
ADMIN_ORIGIN:
15-
required: true
16-
type: string
17-
APP_ORIGIN:
18-
required: true
19-
type: string
20-
REVALIDATOR_PROXY_ORIGIN:
21-
required: true
22-
type: string
23-
DECORATOR_URL:
24-
required: true
25-
type: string
26-
XP_ORIGIN:
27-
required: true
28-
type: string
29-
TELEMETRY_URL:
30-
required: true
31-
type: string
32-
INNLOGGINGSSTATUS_URL:
33-
required: true
34-
type: string
35-
MELDEKORT_API_URL:
36-
required: true
37-
type: string
38-
NAVNO_SEARCH_API_URL:
39-
required: true
40-
type: string
41-
FAILOVER_ORIGIN:
42-
required: true
43-
type: string
44-
RELEASE_TAG:
45-
required: false
46-
type: string
47-
IS_FAILOVER_INSTANCE:
48-
required: false
49-
type: boolean
50-
NODE_ENV:
51-
required: true
52-
type: string
53-
secrets:
54-
READER_TOKEN:
55-
required: true
56-
SERVICE_SECRET:
57-
required: false
58-
NAIS_WORKLOAD_IDENTITY_PROVIDER:
59-
required: true
60-
outputs:
61-
image:
62-
description: "Url to docker image"
63-
value: ${{ jobs.build_image.outputs.image }}
3+
workflow_call:
4+
inputs:
5+
environment:
6+
required: true
7+
type: string
8+
imagename:
9+
required: true
10+
type: string
11+
ENV:
12+
required: true
13+
type: string
14+
ADMIN_ORIGIN:
15+
required: true
16+
type: string
17+
APP_ORIGIN:
18+
required: true
19+
type: string
20+
REVALIDATOR_PROXY_ORIGIN:
21+
required: true
22+
type: string
23+
DECORATOR_URL:
24+
required: true
25+
type: string
26+
XP_ORIGIN:
27+
required: true
28+
type: string
29+
TELEMETRY_URL:
30+
required: true
31+
type: string
32+
INNLOGGINGSSTATUS_URL:
33+
required: true
34+
type: string
35+
MELDEKORT_API_URL:
36+
required: true
37+
type: string
38+
NAVNO_SEARCH_API_URL:
39+
required: true
40+
type: string
41+
FAILOVER_ORIGIN:
42+
required: true
43+
type: string
44+
RELEASE_TAG:
45+
required: false
46+
type: string
47+
IS_FAILOVER_INSTANCE:
48+
required: false
49+
type: boolean
50+
NODE_ENV:
51+
required: true
52+
type: string
53+
secrets:
54+
READER_TOKEN:
55+
required: true
56+
SERVICE_SECRET:
57+
required: false
58+
NAIS_WORKLOAD_IDENTITY_PROVIDER:
59+
required: true
60+
outputs:
61+
image:
62+
description: 'Url to docker image'
63+
value: ${{ jobs.build_image.outputs.image }}
6464

6565
jobs:
66-
build_image:
67-
name: Build docker image
68-
runs-on: ubuntu-latest
69-
permissions:
70-
contents: "read"
71-
id-token: "write"
72-
environment: ${{ inputs.environment }}
73-
outputs:
74-
image: ${{ steps.docker-push.outputs.image }}
75-
steps:
76-
- name: Checkout repo
77-
uses: actions/checkout@v4
78-
- name: Setup node.js
79-
uses: actions/setup-node@v4
80-
with:
81-
node-version: '20'
82-
registry-url: 'https://npm.pkg.github.com'
83-
cache: 'npm'
84-
- name: Set app environmment
85-
run: |
86-
cat > .env <<EOF
87-
ENV=${{ inputs.ENV }}
88-
NODE_ENV=${{ inputs.NODE_ENV }}
89-
ADMIN_ORIGIN=${{ inputs.ADMIN_ORIGIN }}
90-
APP_ORIGIN=${{ inputs.APP_ORIGIN }}
91-
DECORATOR_URL=${{ inputs.DECORATOR_URL }}
92-
XP_ORIGIN=${{ inputs.XP_ORIGIN }}
93-
TELEMETRY_URL=${{ inputs.TELEMETRY_URL }}
94-
REVALIDATOR_PROXY_ORIGIN=${{ inputs.REVALIDATOR_PROXY_ORIGIN }}
95-
FAILOVER_ORIGIN=${{ inputs.FAILOVER_ORIGIN }}
96-
IS_FAILOVER_INSTANCE=${{ inputs.IS_FAILOVER_INSTANCE }}
97-
INNLOGGINGSSTATUS_URL=${{ inputs.INNLOGGINGSSTATUS_URL }}
98-
NAVNO_SEARCH_API_URL=${{ inputs.NAVNO_SEARCH_API_URL }}
99-
MELDEKORT_API_URL=${{ inputs.MELDEKORT_API_URL }}
100-
ASSET_PREFIX=https://cdn.nav.no/personbruker/nav-enonicxp-frontend
101-
IMAGE_CACHE_DIR=/tmp/images
102-
NEXT_TELEMETRY_DISABLED=1
103-
EOF
104-
- name: Nextjs cache
105-
uses: actions/cache@v4
106-
with:
107-
path: ${{ github.workspace }}/.next/cache
108-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
109-
- name: Install dependencies
110-
run: npm ci
111-
env:
112-
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
113-
- name: Run linting
114-
run: npm run lint
115-
- name: Run tests
116-
run: npm run test
117-
- name: Build application
118-
run: npm run build
119-
env:
120-
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
121-
- name: Upload static files to Nav CDN
122-
uses: nais/deploy/actions/cdn-upload/v2@master
123-
with:
124-
team: personbruker
125-
source: ./.next/static
126-
destination: nav-enonicxp-frontend/_next
127-
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
128-
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
129-
- name: Build and push docker image
130-
uses: nais/docker-build-push@v0
131-
id: docker-push
132-
with:
133-
team: personbruker
134-
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
135-
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
136-
image_suffix: ${{ inputs.imagename }}
66+
build_image:
67+
name: Build docker image
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: read
71+
id-token: write
72+
environment: ${{ inputs.environment }}
73+
outputs:
74+
image: ${{ steps.docker-push.outputs.image }}
75+
steps:
76+
- name: Checkout repo
77+
uses: actions/checkout@v4
78+
- name: Setup node.js
79+
uses: actions/setup-node@v4
80+
with:
81+
node-version: 20
82+
registry-url: 'https://npm.pkg.github.com'
83+
cache: 'npm'
84+
- name: Set app environmment
85+
run: |
86+
cat > .env <<EOF
87+
ENV=${{ inputs.ENV }}
88+
NODE_ENV=${{ inputs.NODE_ENV }}
89+
ADMIN_ORIGIN=${{ inputs.ADMIN_ORIGIN }}
90+
APP_ORIGIN=${{ inputs.APP_ORIGIN }}
91+
DECORATOR_URL=${{ inputs.DECORATOR_URL }}
92+
XP_ORIGIN=${{ inputs.XP_ORIGIN }}
93+
TELEMETRY_URL=${{ inputs.TELEMETRY_URL }}
94+
REVALIDATOR_PROXY_ORIGIN=${{ inputs.REVALIDATOR_PROXY_ORIGIN }}
95+
FAILOVER_ORIGIN=${{ inputs.FAILOVER_ORIGIN }}
96+
IS_FAILOVER_INSTANCE=${{ inputs.IS_FAILOVER_INSTANCE }}
97+
INNLOGGINGSSTATUS_URL=${{ inputs.INNLOGGINGSSTATUS_URL }}
98+
NAVNO_SEARCH_API_URL=${{ inputs.NAVNO_SEARCH_API_URL }}
99+
MELDEKORT_API_URL=${{ inputs.MELDEKORT_API_URL }}
100+
ASSET_PREFIX=https://cdn.nav.no/personbruker/nav-enonicxp-frontend
101+
IMAGE_CACHE_DIR=/tmp/images
102+
NEXT_TELEMETRY_DISABLED=1
103+
EOF
104+
- name: Nextjs cache
105+
uses: actions/cache@v4
106+
with:
107+
path: ${{ github.workspace }}/.next/cache
108+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
109+
- name: Install dependencies
110+
run: npm ci
111+
env:
112+
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
113+
- name: Run linting
114+
run: npm run lint
115+
- name: Run tests
116+
run: npm run test
117+
- name: Build application
118+
run: npm run build
119+
env:
120+
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
121+
- name: Upload static files to Nav CDN
122+
uses: nais/deploy/actions/cdn-upload/v2@master
123+
with:
124+
team: personbruker
125+
source: ./.next/static
126+
destination: nav-enonicxp-frontend/_next
127+
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
128+
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
129+
- name: Build and push docker image
130+
uses: nais/docker-build-push@v0
131+
id: docker-push
132+
with:
133+
team: personbruker
134+
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
135+
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
136+
image_suffix: ${{ inputs.imagename }}

.github/workflows/deploy-alerts.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
name: Deploy prod-alerts
22
on:
3-
push:
4-
branches:
5-
- main
6-
paths:
7-
- .nais/alerts.yml
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- .nais/alerts.yml
88

99
jobs:
10-
deploy_alerts:
11-
name: Deploy nais-alerts
12-
runs-on: ubuntu-latest
13-
permissions:
14-
id-token: "write"
15-
steps:
16-
- name: Checkout repo
17-
uses: actions/checkout@v3
18-
- name: Deploy to nais
19-
uses: nais/deploy/actions/deploy@v2
20-
env:
21-
CLUSTER: prod-gcp
22-
RESOURCE: .nais/alerts.yml
10+
deploy_alerts:
11+
name: Deploy nais-alerts
12+
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v3
18+
- name: Deploy to nais
19+
uses: nais/deploy/actions/deploy@v2
20+
env:
21+
CLUSTER: prod-gcp
22+
RESOURCE: .nais/alerts.yml

0 commit comments

Comments
 (0)