Skip to content

Merge pull request #519 from navikt/bytt-datasett-prod-v2023 #257

Merge pull request #519 from navikt/bytt-datasett-prod-v2023

Merge pull request #519 from navikt/bytt-datasett-prod-v2023 #257

name: Build, push, and deploy app to dev and prod
on:
push:
branches:
- 'master'
env:
IMAGE: ghcr.io/navikt/familie-ef-veiviser:${{ github.sha }}
jobs:
build:
name: Build and push Docker container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: npm
registry-url: "https://npm.pkg.github.com"
- name: Npm install dev and build
run: |
npm ci
npm run build
env:
NPM_TOKEN: ${{ secrets.READER_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Build and publish Docker image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker build . -t ${IMAGE}
echo ${GITHUB_TOKEN} | docker login ghcr.io --username ${GITHUB_REPOSITORY} --password-stdin
docker push ${IMAGE}
deploy:
name: Deploy to NAIS
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais-dev.yaml
- name: Deploy til prod-gcp
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: nais-prod.yaml