Skip to content

Merge pull request #805 from navikt/relax_iso8601scalar #29

Merge pull request #805 from navikt/relax_iso8601scalar

Merge pull request #805 from navikt/relax_iso8601scalar #29

name: "Fake produsent api: build and deploy"
on:
push:
branches:
- main
paths:
- app/src/main/resources/produsent.graphql
- fake-produsent-api/**
workflow_dispatch:
schedule:
- cron: '0 6 * * 1'
jobs:
build_and_push:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- 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: fake-produsent-api/server/package-lock.json
- run: npm ci
working-directory: fake-produsent-api/server
- run: npm run gql:cp_schema
working-directory: fake-produsent-api/server
- uses: nais/docker-build-push@v0
id: docker-push
with:
team: fager
docker_context: fake-produsent-api/
dockerfile: fake-produsent-api/Dockerfile
image_suffix: fake-produsent-api
tag: ${{ github.sha }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
- uses: nais/deploy/actions/deploy@v2
env:
VAR: image=${{ steps.docker-push.outputs.image }}
CLUSTER: dev-gcp
RESOURCE: fake-produsent-api/nais-application.yaml
PRINT_PAYLOAD: true
ghcr_push:
if: github.ref == 'refs/heads/main'
permissions:
packages: write
contents: read
runs-on: ubuntu-latest
steps:
- 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: fake-produsent-api/server/package-lock.json
- run: npm ci
working-directory: fake-produsent-api/server
- run: npm run gql:cp_schema
working-directory: fake-produsent-api/server
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: fake-produsent-api
push: true
tags: ghcr.io/${{ github.repository }}/fake-produsent-api:latest