-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (61 loc) · 2.3 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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@8df1039502a15bceb9433410b1a100fbe190c53b # ratchet:actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # ratchet:gradle/actions/setup-gradle@v4
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@d156388eb19639ec20ade50009f3d199ce1e2808 # 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/deploy/actions/deploy@v2 # ratchet:exclude
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
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:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: .nais/${{ matrix.module }}-token-generator.yaml
IMAGE: ${{ steps.build_push_sign.outputs.tag }}