Bort fra data class i API - take2 #646
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: "Tjenestebuss-integrasjon" | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- "build.gradle.kts" | |
- "gradle.properties" | |
- "gradle/libs.versions.toml" | |
- "tjenestebuss-integrasjon/**" | |
- ".github/workflows/tjenestebuss-integrasjon.yml" | |
push: | |
branches: | |
- "main" | |
paths: | |
- "build.gradle.kts" | |
- "gradle.properties" | |
- "gradle/libs.versions.toml" | |
- "tjenestebuss-integrasjon/**" | |
- ".github/workflows/tjenestebuss-integrasjon.yml" | |
env: | |
JavaDistribution: "temurin" | |
JavaVersion: 21 | |
jobs: | |
build-tjenestebuss-integrasjon: | |
name: "Build tjenestebuss-integrasjon backend" | |
runs-on: "ubuntu-latest" | |
permissions: | |
contents: "read" | |
packages: "read" | |
id-token: "write" | |
outputs: | |
image: ${{ steps.docker-push.outputs.image }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: "gradle/actions/wrapper-validation@v4" | |
- uses: "gradle/actions/setup-gradle@v4" | |
- uses: "actions/setup-java@v4" | |
with: | |
"distribution": ${{ env.JavaDistribution }} | |
"java-version": ${{ env.JavaVersion }} | |
- name: "compile and run tests" | |
run: | | |
./gradlew :tjenestebuss-integrasjon:build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Build and publish container image to GAR" | |
uses: nais/docker-build-push@v0 | |
id: docker-push | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' | |
with: | |
team: pensjonsbrev | |
image_suffix: tjenestebuss-integrasjon | |
push_image: true | |
pull: true | |
docker_context: ./tjenestebuss-integrasjon | |
dockerfile: tjenestebuss-integrasjon/Dockerfile | |
deploy-tjenestebuss-integrasjon-dev: | |
name: "Deploy tjenestebuss-integrasjon to dev" | |
permissions: | |
contents: "read" | |
id-token: "write" | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' | |
needs: "build-tjenestebuss-integrasjon" | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: "Deploy tjenestebus-integrasjon backend to DEV" | |
uses: "nais/deploy/actions/deploy@v2" | |
env: | |
"ENVIRONMENT": "dev-fss:tjenestebuss-integrasjon" | |
"CLUSTER": "dev-fss" | |
"RESOURCE": "tjenestebuss-integrasjon/.nais/nais.yaml" | |
"VAR": image=${{ needs.build-tjenestebuss-integrasjon.outputs.image }} | |
"VARS": "tjenestebuss-integrasjon/.nais/dev-q2.yaml" | |
deploy-tjenestebuss-integrasjon-prod: | |
name: "Deploy tjenestebuss-integrasjon to prod" | |
permissions: | |
contents: "read" | |
id-token: "write" | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: "build-tjenestebuss-integrasjon" | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: "Deploy tjenestebus-integrasjon backend to prod" | |
uses: "nais/deploy/actions/deploy@v2" | |
env: | |
"ENVIRONMENT": "prod-fss:tjenestebuss-integrasjon" | |
"CLUSTER": "prod-fss" | |
"RESOURCE": "tjenestebuss-integrasjon/.nais/nais.yaml" | |
"VAR": image=${{ needs.build-tjenestebuss-integrasjon.outputs.image }} | |
"VARS": "tjenestebuss-integrasjon/.nais/prod.yaml" |