Skip to content

Bump next from 12.3.4 to 14.2.1 #359

Bump next from 12.3.4 to 14.2.1

Bump next from 12.3.4 to 14.2.1 #359

Workflow file for this run

name: Build and deploy
on: [ push ]
env:
IMAGE: ghcr.io/${{ github.repository }}:${{ github.sha }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
registry-url: "https://npm.pkg.github.com"
- run: npm ci --legacy-peer-deps --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- run: npm rebuild && npm run prepare --if-present
- run: npm run build --if-present
- run: npm test
env:
CI: true
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
registry-url: "https://npm.pkg.github.com"
- run: cp $NPM_CONFIG_USERCONFIG .npmrc
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
tags: ${{ env.IMAGE }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: |
"NODE_AUTH_TOKEN=${{ secrets.READER_TOKEN }}"
deploy-dev:
needs: [ test, build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@master
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: .nais/nais.yaml
VARS: .nais/vars-dev.yaml
PRINT_PAYLOAD: true
deploy-prod:
needs: [ deploy-dev ]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@master
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .nais/nais.yaml
VARS: .nais/vars-prod.yaml
PRINT_PAYLOAD: true