Skip to content

Merge pull request #580 from navikt/dependabot/npm_and_yarn/minor-and… #280

Merge pull request #580 from navikt/dependabot/npm_and_yarn/minor-and…

Merge pull request #580 from navikt/dependabot/npm_and_yarn/minor-and… #280

name: Build, push, and deploy app to dev and prod
on:
push:
branches:
- 'main'
permissions:
id-token: write
contents: read
jobs:
build:
name: Build and push Docker container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
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: Push docker image to GAR and sign image
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: teamfamilie
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
deploy:
name: Deploy to GCP
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: nais-dev.yaml
IMAGE: ${{ needs.build.outputs.image }}
- name: Deploy til prod-gcp
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: nais-prod.yaml
IMAGE: ${{ needs.build.outputs.image }}