🔧 Trenger ikke 96 cores lenger.. #91
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: Spoogle | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'deploy/**' | |
- 'spoogle-backend/**' | |
- 'spoogle-frontend/**' | |
- 'build.gradle.kts' | |
- '.github/workflows/**' | |
- 'Dockerfile' | |
branches: | |
- main | |
jobs: | |
build: | |
permissions: | |
contents: "read" | |
id-token: "write" | |
name: Bygg | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21.x' | |
cache: 'gradle' | |
- name: Test og bygg | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: :spoogle-frontend:build :spoogle-backend:test :spoogle-backend:build | |
env: | |
ORG_GRADLE_PROJECT_githubUser: x-access-token | |
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }} | |
- name: Lag Docker image | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: tbd | |
cache_from: type=gha | |
cache_to: type=gha,mode=max | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
analyze: | |
name: Kontroller sårbarheter | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ["kotlin"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21.x' | |
cache: 'gradle' | |
- name: Build | |
run: ./gradlew clean build --no-build-cache -x test | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/language:${{matrix.language}}" | |
deployDev: | |
name: Deploy til dev | |
needs: [build, analyze] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: deploy/dev.yml | |
IMAGE: ${{ needs.build.outputs.image }} | |
deployProd: | |
name: Deploy til prod | |
needs: [build, analyze] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-gcp | |
RESOURCE: deploy/prod.yml | |
IMAGE: ${{ needs.build.outputs.image }} |