deps(kts): test containers #181
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: Build, push and sign | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "*.md" | |
jobs: | |
build_push_sign: | |
permissions: | |
contents: "write" | |
id-token: "write" | |
packages: "write" | |
outputs: | |
img_to_deploy: ${{ steps.build-push-sign.outputs.tag }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
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@473878a77f1b98e2b5ac4af93489d1656a80a5ed # ratchet:gradle/actions/setup-gradle@v4 | |
- name: Generate and submit dependency graph | |
uses: gradle/actions/dependency-submission@473878a77f1b98e2b5ac4af93489d1656a80a5ed # ratchet:gradle/actions/dependency-submission@v4 | |
- name: Gradle build | |
run: ./gradlew build | |
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # ratchet:sigstore/cosign-installer@v3 | |
- name: Verify distroless base image | |
run: | | |
cosign verify \ | |
--certificate-identity "keyless@distroless.iam.gserviceaccount.com" \ | |
--certificate-oidc-issuer "https://accounts.google.com" \ | |
gcr.io/distroless/java21-debian12:nonroot | |
- name: "Build and push image" | |
uses: nais/platform-build-push-sign@main # ratchet:exclude | |
id: build-push-sign | |
with: | |
name: tokendings | |
google_service_account: gh-tokendings | |
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }} | |
push_ghcr: true | |
multi-platform: true |