Skip to content

build(deps): bump com.gradleup.shadow from 8.3.8 to 9.3.0 (#1227) #172

build(deps): bump com.gradleup.shadow from 8.3.8 to 9.3.0 (#1227)

build(deps): bump com.gradleup.shadow from 8.3.8 to 9.3.0 (#1227) #172

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@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'
- name: Set up gradle # v5.0.0
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Build with Gradle
run: ./gradlew build -p web --no-daemon --build-cache --info
- name: Authenticate to Google Cloud # v3.0.0
id: "auth"
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
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 # v3.6.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
with:
registry: ${{ env.REGISTRY }}
username: "oauth2accesstoken"
password: "${{ steps.auth.outputs.access_token }}"
- name: Build and push Docker images # v6.18.0
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
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@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Deploy to NAIS Test # v2
uses: nais/deploy/actions/deploy@fa754451577294aae42872a69b888b3470478ec1
env:
CLUSTER: test
RESOURCE: .nais/test.yaml
VAR: image=${{needs.setup.outputs.docker-image}}
DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443