Skip to content

Bygg og deploy branch til dev-gcp #157

Bygg og deploy branch til dev-gcp

Bygg og deploy branch til dev-gcp #157

Workflow file for this run

name: Bygg og deploy branch til dev-gcp
on: workflow_dispatch
jobs:
build:
name: Bygg
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Oppsett Java 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Bygg og test med Maven
run: mvn package -B -Dsurefire.useFile=false
- name: Push docker image to GAR
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: arbeidsgiver
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
deploy-dev:
name: Deploy til dev
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: .nais/nais.yml,.nais/unleash-apitoken.yml
VARS: .nais/dev.yml
VAR: image=${{ needs.build.outputs.image }}
deploy-dev-gcp-labs:
name: Deploy til dev-gcp (tidligere labs)
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Generer tiltak-refusjon-api-wiremock configmap
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
./kubectl create configmap --dry-run=client -o yaml --from-file src/test/resources/mappings -n arbeidsgiver tiltak-refusjon-api-wiremock > .nais/wiremock-mappings.yml
cat .nais/wiremock-mappings.yml # debug
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: .nais/dev-gcp-labs.yml,.nais/wiremock.yml,.nais/wiremock-mappings.yml
VAR: deploytrigger=${{ github.run_number }},image=${{ needs.build.outputs.image }}