Skip to content

Fiks datofeil i testkode + legg til Java versjon i bygget (#21) #558

Fiks datofeil i testkode + legg til Java versjon i bygget (#21)

Fiks datofeil i testkode + legg til Java versjon i bygget (#21) #558

Workflow file for this run

name: Build & deploy
on: [push]
permissions:
packages: write
contents: read
id-token: write
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run tests
run: ./gradlew test --info
deploy-to-dev:
name: Deploy til dev
needs: test
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/bruk-stillingstittel-beriket'
runs-on: ubuntu-latest
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.x'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Bygg jar med Gradle
run: ./gradlew shadowJar
- name: Push docker image to GAR
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: toi
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
- uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
VAR: image=${{ steps.docker-build-push.outputs.image }}
RESOURCE: nais/nais.yaml
VARS: nais/nais-dev.json
deploy-to-prod:
name: Deploy til prod
needs: deploy-to-dev
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
VAR: image=${{ needs.deploy-to-dev.outputs.image }}
RESOURCE: nais/nais.yaml
VARS: nais/nais-prod.json
deploy-alerts:
name: Deploy alerts to prod
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: nais/alerts.yaml