Skip to content

Testprodusent: build and deploy #19

Testprodusent: build and deploy

Testprodusent: build and deploy #19

name: "Testprodusent: build and deploy"
on:
push:
branches:
- main
paths:
- test-produsent/**
workflow_dispatch:
schedule:
- cron: '0 6 * * 1'
jobs:
build_and_push:
permissions:
contents: "read"
id-token: "write"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: https://npm.pkg.github.com/
cache: 'npm'
cache-dependency-path: test-produsent/server/package-lock.json
- run: npm ci
working-directory: test-produsent/server
- run: npm ci
working-directory: test-produsent
- run: npm run build
working-directory: test-produsent
- uses: nais/docker-build-push@v0
id: docker-push
with:
team: fager
docker_context: test-produsent/
dockerfile: test-produsent/Dockerfile
image_suffix: test-produsent
tag: ${{ github.sha }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
- uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: test-produsent/nais-application.yaml
PRINT_PAYLOAD: true
VAR: commit=${{ github.sha }},image=${{ steps.docker-push.outputs.image }}