Skip to content

build(deps): bump io.micronaut.platform:micronaut-parent from 4.8.3 t… #111

build(deps): bump io.micronaut.platform:micronaut-parent from 4.8.3 t…

build(deps): bump io.micronaut.platform:micronaut-parent from 4.8.3 t… #111

Workflow file for this run

name: Build and deploy
on:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: write
id-token: write
env:
REGISTRY: europe-north1-docker.pkg.dev/artifact-registry-5n/kostra-docker
IMAGE: kostra-kontrollprogram
jobs:
setup:
name: Setup global environment variable
environment: setup
runs-on: ubuntu-24.04
# Map a step output to a job output
outputs:
docker-image: ${{ steps.setup.outputs.image }}
steps:
- name: Create and store image tag
id: setup
run: echo "image=${REGISTRY}/${IMAGE}:$(date +'%Y%m%d')-${{github.run_number}}" >> "$GITHUB_OUTPUT"
- name: Echo image tag
run: echo ${{ steps.setup.outputs.image }}
docker_build:
name: Create Docker image
environment: build
runs-on: ubuntu-24.04
needs: setup
permissions:
contents: write
id-token: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Set up gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Build with Gradle
run: ./gradlew build -p web --build-cache --info
- name: Authenticate to Google Cloud
id: "auth"
uses: google-github-actions/auth@v2.1.10
with:
workload_identity_provider: "projects/${{ vars.GAR_PROJECT_NUMBER }}/locations/global/workloadIdentityPools/gh-actions/providers/gh-actions"
service_account: "gh-actions-kostra@${{ vars.GAR_PROJECT_ID }}.iam.gserviceaccount.com"
token_format: "access_token"
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: "oauth2accesstoken"
password: "${{ steps.auth.outputs.access_token }}"
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: ./web
push: true
provenance: false
tags: |
${{needs.setup.outputs.docker-image}}
test_deploy:
name: Deploy to NAIS test
environment: test
runs-on: ubuntu-24.04
needs: [setup, docker_build]
permissions:
contents: write
id-token: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Deploy to NAIS Test
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: test
RESOURCE: .nais/test.yaml
VAR: image=${{needs.setup.outputs.docker-image}}
DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443