Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic release #2183

Merged
merged 14 commits into from
Feb 25, 2025
45 changes: 22 additions & 23 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
name: Build and test

on:
push:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Run linting
run: npm run lint
- name: Build application
run: npm run build-local
- name: Run tests
run: npm run test
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Run linting
run: npm run lint
- name: Build application
run: npm run build-local
- name: Run tests
run: npm run test
264 changes: 132 additions & 132 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -1,136 +1,136 @@
name: Build docker image
on:
workflow_call:
inputs:
environment:
required: true
type: string
imagename:
required: true
type: string
ENV:
required: true
type: string
ADMIN_ORIGIN:
required: true
type: string
APP_ORIGIN:
required: true
type: string
REVALIDATOR_PROXY_ORIGIN:
required: true
type: string
DECORATOR_URL:
required: true
type: string
XP_ORIGIN:
required: true
type: string
TELEMETRY_URL:
required: true
type: string
INNLOGGINGSSTATUS_URL:
required: true
type: string
MELDEKORT_API_URL:
required: true
type: string
NAVNO_SEARCH_API_URL:
required: true
type: string
FAILOVER_ORIGIN:
required: true
type: string
RELEASE_TAG:
required: false
type: string
IS_FAILOVER_INSTANCE:
required: false
type: boolean
NODE_ENV:
required: true
type: string
secrets:
READER_TOKEN:
required: true
SERVICE_SECRET:
required: false
NAIS_WORKLOAD_IDENTITY_PROVIDER:
required: true
outputs:
image:
description: "Url to docker image"
value: ${{ jobs.build_image.outputs.image }}
workflow_call:
inputs:
environment:
required: true
type: string
imagename:
required: true
type: string
ENV:
required: true
type: string
ADMIN_ORIGIN:
required: true
type: string
APP_ORIGIN:
required: true
type: string
REVALIDATOR_PROXY_ORIGIN:
required: true
type: string
DECORATOR_URL:
required: true
type: string
XP_ORIGIN:
required: true
type: string
TELEMETRY_URL:
required: true
type: string
INNLOGGINGSSTATUS_URL:
required: true
type: string
MELDEKORT_API_URL:
required: true
type: string
NAVNO_SEARCH_API_URL:
required: true
type: string
FAILOVER_ORIGIN:
required: true
type: string
RELEASE_TAG:
required: false
type: string
IS_FAILOVER_INSTANCE:
required: false
type: boolean
NODE_ENV:
required: true
type: string
secrets:
READER_TOKEN:
required: true
SERVICE_SECRET:
required: false
NAIS_WORKLOAD_IDENTITY_PROVIDER:
required: true
outputs:
image:
description: 'Url to docker image'
value: ${{ jobs.build_image.outputs.image }}

jobs:
build_image:
name: Build docker image
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
environment: ${{ inputs.environment }}
outputs:
image: ${{ steps.docker-push.outputs.image }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Set app environmment
run: |
cat > .env <<EOF
ENV=${{ inputs.ENV }}
NODE_ENV=${{ inputs.NODE_ENV }}
ADMIN_ORIGIN=${{ inputs.ADMIN_ORIGIN }}
APP_ORIGIN=${{ inputs.APP_ORIGIN }}
DECORATOR_URL=${{ inputs.DECORATOR_URL }}
XP_ORIGIN=${{ inputs.XP_ORIGIN }}
TELEMETRY_URL=${{ inputs.TELEMETRY_URL }}
REVALIDATOR_PROXY_ORIGIN=${{ inputs.REVALIDATOR_PROXY_ORIGIN }}
FAILOVER_ORIGIN=${{ inputs.FAILOVER_ORIGIN }}
IS_FAILOVER_INSTANCE=${{ inputs.IS_FAILOVER_INSTANCE }}
INNLOGGINGSSTATUS_URL=${{ inputs.INNLOGGINGSSTATUS_URL }}
NAVNO_SEARCH_API_URL=${{ inputs.NAVNO_SEARCH_API_URL }}
MELDEKORT_API_URL=${{ inputs.MELDEKORT_API_URL }}
ASSET_PREFIX=https://cdn.nav.no/personbruker/nav-enonicxp-frontend
IMAGE_CACHE_DIR=/tmp/images
NEXT_TELEMETRY_DISABLED=1
EOF
- name: Nextjs cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Run linting
run: npm run lint
- name: Run tests
run: npm run test
- name: Build application
run: npm run build
env:
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
- name: Upload static files to Nav CDN
uses: nais/deploy/actions/cdn-upload/v2@master
with:
team: personbruker
source: ./.next/static
destination: nav-enonicxp-frontend/_next
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
- name: Build and push docker image
uses: nais/docker-build-push@v0
id: docker-push
with:
team: personbruker
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
image_suffix: ${{ inputs.imagename }}
build_image:
name: Build docker image
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment: ${{ inputs.environment }}
outputs:
image: ${{ steps.docker-push.outputs.image }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Set app environmment
run: |
cat > .env <<EOF
ENV=${{ inputs.ENV }}
NODE_ENV=${{ inputs.NODE_ENV }}
ADMIN_ORIGIN=${{ inputs.ADMIN_ORIGIN }}
APP_ORIGIN=${{ inputs.APP_ORIGIN }}
DECORATOR_URL=${{ inputs.DECORATOR_URL }}
XP_ORIGIN=${{ inputs.XP_ORIGIN }}
TELEMETRY_URL=${{ inputs.TELEMETRY_URL }}
REVALIDATOR_PROXY_ORIGIN=${{ inputs.REVALIDATOR_PROXY_ORIGIN }}
FAILOVER_ORIGIN=${{ inputs.FAILOVER_ORIGIN }}
IS_FAILOVER_INSTANCE=${{ inputs.IS_FAILOVER_INSTANCE }}
INNLOGGINGSSTATUS_URL=${{ inputs.INNLOGGINGSSTATUS_URL }}
NAVNO_SEARCH_API_URL=${{ inputs.NAVNO_SEARCH_API_URL }}
MELDEKORT_API_URL=${{ inputs.MELDEKORT_API_URL }}
ASSET_PREFIX=https://cdn.nav.no/personbruker/nav-enonicxp-frontend
IMAGE_CACHE_DIR=/tmp/images
NEXT_TELEMETRY_DISABLED=1
EOF
- name: Nextjs cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Run linting
run: npm run lint
- name: Run tests
run: npm run test
- name: Build application
run: npm run build
env:
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
- name: Upload static files to Nav CDN
uses: nais/deploy/actions/cdn-upload/v2@master
with:
team: personbruker
source: ./.next/static
destination: nav-enonicxp-frontend/_next
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
- name: Build and push docker image
uses: nais/docker-build-push@v0
id: docker-push
with:
team: personbruker
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
image_suffix: ${{ inputs.imagename }}
36 changes: 18 additions & 18 deletions .github/workflows/deploy-alerts.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: Deploy prod-alerts
on:
push:
branches:
- main
paths:
- .nais/alerts.yml
push:
branches:
- main
paths:
- .nais/alerts.yml

jobs:
deploy_alerts:
name: Deploy nais-alerts
runs-on: ubuntu-latest
permissions:
id-token: "write"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Deploy to nais
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: .nais/alerts.yml
deploy_alerts:
name: Deploy nais-alerts
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Deploy to nais
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: .nais/alerts.yml
Loading
Loading