Skip to content

Merge pull request #1281 from navikt/feature/pdl_changes #3623

Merge pull request #1281 from navikt/feature/pdl_changes

Merge pull request #1281 from navikt/feature/pdl_changes #3623

Workflow file for this run

name: Build, push, and deploy
on: [push]
concurrency:
group: main-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
TZ: Europe/Oslo
Q1_TEST_BRANCH: 'refs/heads/fix/spring-version'
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
id-token: write
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- uses: nbadal/action-ktlint-setup@v1
with:
ktlint_version: '1.2.1'
- name: Ktlint
run: bash ./linting.sh
- name: Build using maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn -P ci -B test --settings .github/maven-settings.xml
mvn -P ci -B package --settings .github/maven-settings.xml -DskipTests
- name: Publish Dev Image
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master'
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: personoversikt
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
- name: Deploy to Q1 (Test branch)
uses: nais/deploy/actions/deploy@v2
if: github.ref == env.Q1_TEST_BRANCH
env:
PRINT_PAYLOAD: true
CLUSTER: dev-fss
RESOURCE: .nais/nais-q1.yml
VAR: version=${{ github.sha }},image=${{ steps.docker-build-push.outputs.image }}
deploy-qa:
name: Deploy to preprod
needs: build
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
namespace: [q0, q1]
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
env:
PRINT_PAYLOAD: true
CLUSTER: dev-fss
RESOURCE: .nais/nais-${{ matrix.namespace }}.yml
VAR: version=${{ github.sha }},image=${{ needs.build.outputs.image }}
deploy-prod:
name: Deploy to prod
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
env:
PRINT_PAYLOAD: true
CLUSTER: prod-fss
RESOURCE: .nais/nais.yml
VAR: version=${{ github.sha }},image=${{ needs.build.outputs.image }}