Skip to content

Bump lint-staged from 15.1.0 to 15.2.2 (#1677) #157

Bump lint-staged from 15.1.0 to 15.2.2 (#1677)

Bump lint-staged from 15.1.0 to 15.2.2 (#1677) #157

name: Build&deploy to prod
on:
workflow_dispatch:
push:
branches:
- main
env:
IMAGE: ghcr.io/navikt/familie-tilbake-frontend:${{ github.sha }}
IMAGE_LATEST: ghcr.io/navikt/familie-tilbake-frontend:latest
VERSION: familie-tilbake-frontend:${{ github.sha }}
jobs:
build:
name: Build and push Docker container
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: yarn
registry-url: "https://npm.pkg.github.com"
- name: Login to GitHub Container Registry
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish Docker image
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_RELEASE: ${{ github.sha }}
run: |
yarn
yarn build
yarn test
docker build . -t ${IMAGE} -t ${IMAGE_LATEST}
docker push ${IMAGE}
docker push ${IMAGE_LATEST}
deploy:
name: Deploy to NAIS / GCP
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: build_n_deploy/naiserator/naiserator_dev_gcp.yaml
VAR: VERSION=${{ env.VERSION }}
- name: Deploy til prod-gcp
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: build_n_deploy/naiserator/naiserator_prod_gcp.yaml
VAR: VERSION=${{ env.VERSION }}