feat: replace custom Ktor route plugin with AuthenticationProvider #93
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build and push | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
strategy: | |
matrix: | |
module: | |
- azure | |
- idporten | |
- maskinporten | |
include: | |
- module: azure | |
token-generator: true | |
- module: idporten | |
token-generator: true | |
steps: | |
- name: Checkout latest code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # ratchet:actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # ratchet:gradle/actions/setup-gradle@v4 | |
- name: Generate and submit dependency graph | |
uses: gradle/actions/dependency-submission@94baf225fe0a508e581a564467443d0e2379123b # ratchet:gradle/actions/dependency-submission@v4 | |
- name: Build with Gradle | |
run: ./gradlew clean wonderwalled-${{ matrix.module }}:build wonderwalled-${{ matrix.module }}:shadowJar | |
- uses: nais/platform-build-push-sign@main # ratchet:exclude | |
id: build_push_sign | |
with: | |
name: wonderwalled-${{ matrix.module }} | |
context: ./wonderwalled-${{ matrix.module }} | |
dockerfile: ./wonderwalled-${{ matrix.module }}/Dockerfile | |
google_service_account: gh-wonderwalled | |
multi-platform: true | |
push: true | |
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }} | |
- uses: nais/login@v0 # ratchet:exclude | |
with: | |
team: nais | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} # Provided as Organization Secret | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} # Provided as Organization Variable | |
- uses: nais/deploy/actions/deploy@v2 # ratchet:exclude | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/${{ matrix.module }}.yaml | |
IMAGE: ${{ steps.build_push_sign.outputs.tag }} | |
- uses: nais/deploy/actions/deploy@v2 # ratchet:exclude | |
if: matrix.token-generator | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/${{ matrix.module }}-token-generator.yaml | |
IMAGE: ${{ steps.build_push_sign.outputs.tag }} |