Skip to content

Build and deploy || Merge pull request #387 from navikt/definer-næringskonsept Fjern Virksomhetsklassifikasjon #188

Build and deploy || Merge pull request #387 from navikt/definer-næringskonsept Fjern Virksomhetsklassifikasjon

Build and deploy || Merge pull request #387 from navikt/definer-næringskonsept Fjern Virksomhetsklassifikasjon #188

Workflow file for this run

name: Build and deploy
run-name: Build and deploy || ${{ github.event.head_commit.message }}
on: [ push ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docker-build-push:
name: Build, test and push docker image
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
cache: maven
- name: Run tests
run: mvn test
- name: Build jar with Maven
run: mvn package -DskipTests
- uses: nais/docker-build-push@v0
id: docker-push
with:
team: teamia
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
salsa: false
outputs:
image: ${{ steps.docker-push.outputs.image }}
deploy-to-dev:
name: Deploy to dev-fss
needs: docker-build-push
if: github.ref == 'refs/heads/definer-næringskonsept'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
CLUSTER: dev-fss
IMAGE: ${{ needs.docker-build-push.outputs.image }}
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
RESOURCE: nais/dev.yaml
deploy-to-prod:
name: Deploy to prod-fss
needs: docker-build-push
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
CLUSTER: prod-fss
IMAGE: ${{ needs.docker-build-push.outputs.image }}
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
RESOURCE: nais/prod.yaml
deployTopicsToDev:
name: Deploy topics to dev
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/branch'
steps:
- uses: actions/checkout@v3
- name: Deploy topics to dev-fss
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: "\
nais/topics/topic-arbeidsgiver-sykefravaer-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-land-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-virksomhet-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-naring-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-sektor-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-bransje-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-metadata-virksomhet-dev.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-naringskode-dev.yaml"
deployTopicsToProd:
name: Deploy topics to prod
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Deploy topics to prod-fss
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: "\
nais/topics/topic-arbeidsgiver-sykefravaer-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-land-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-virksomhet-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-naring-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-sektor-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-bransje-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-metadata-virksomhet-prod.yaml,\
nais/topics/topic-arbeidsgiver-sykefravarsstatistikk-naringskode-prod.yaml"