Skip to content

Bump kotlin, kotest; update README #31

Bump kotlin, kotest; update README

Bump kotlin, kotest; update README #31

Workflow file for this run

name: Build, push, deploy
on:
push:
branches:
- main
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- 'README.md'
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
id-token: write
packages: write
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
cache: maven
java-version: 21
distribution: temurin
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Create Docker image
id: image-creation
uses: nais/docker-build-push@v0
with:
dockerfile: .docker/Dockerfile
team: pensjonskalkulator
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
outputs:
image: ${{ steps.image-creation.outputs.image }}
deploy-dev:
name: Deploy to dev-gcp
needs: [ build ]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
IMAGE: ${{ needs.build.outputs.image }}
RESOURCE: .nais/deploy-dev.yml
trivy-imagescan:
name: Scan Docker image
needs: [ build ]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
id-token: write
security-events: write
steps:
- uses: nais/login@v0
with:
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
team: pensjonskalkulator
- name: Run Trivy vulnerability scanner on Docker image
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ needs.build.outputs.image }}
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'MEDIUM,HIGH,CRITICAL'
limit-severities-for-sarif: true
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'