Skip to content

Merge pull request #341 from navikt/rm_innlogget #763

Merge pull request #341 from navikt/rm_innlogget

Merge pull request #341 from navikt/rm_innlogget #763

Workflow file for this run

name: Test, bygg, deploy
on:
push:
workflow_dispatch:
jobs:
bygg:
name: Bygg
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
services:
postgres:
image: postgres:12.10
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 2345:5432
mock-oauth2-server:
image: ghcr.io/navikt/mock-oauth2-server:2.0.1
env:
JSON_CONFIG: >
{
"interactiveLogin": true,
"httpServer": "NettyWrapper",
"tokenCallbacks": [
{
"issuerId": "faketokenx",
"tokenExpiry": 600000,
"requestMappings": [
{
"requestParam": "acr",
"match": "Level4",
"claims": {
"sub": "42",
"aud": "someaudience",
"pid": "42",
"acr": "Level4"
}
},
{
"requestParam": "acr",
"match": "idporten-loa-high",
"claims": {
"sub": "42",
"aud": "someaudience",
"pid": "42",
"acr": "idporten-loa-high"
}
}
]
}
]
}
ports:
- 8118:8080
steps:
- uses: actions/checkout@v3
- run: PGPASSWORD=postgres psql -U postgres -h localhost -p 2345 -f ./local-db-init.sql
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: maven
- run: mvn -B package
- uses: nais/docker-build-push@v0
id: gar-push
with:
team: fager
tag: ${{ github.sha }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
deploy-dev-gcp:
permissions:
contents: "read"
id-token: "write"
name: Deploy dev (dev-gcp)
needs: bygg
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: nais/login@v0
id: login
with:
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
team: fager
- uses: nais/deploy/actions/deploy@v1
env:
IMAGE: ${{ steps.login.outputs.registry }}/min-side-arbeidsgiver-api:${{ github.sha }}
RESOURCE: nais/dev-env.yaml
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
deploy-prod-gcp:
permissions:
contents: "read"
id-token: "write"
name: Deploy prod (prod-gcp)
needs: deploy-dev-gcp
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/login@v0
id: login
with:
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
team: fager
- uses: nais/deploy/actions/deploy@v1
env:
IMAGE: ${{ steps.login.outputs.registry }}/min-side-arbeidsgiver-api:${{ github.sha }}
RESOURCE: nais/prod-env.yaml
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp