Skip to content

Commit

Permalink
Tar i bruk reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
espenjv committed Apr 18, 2024
1 parent b9552c0 commit ae868ca
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 131 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "Bygg og deploy"
on:
push:
branches:
- '**'
paths-ignore:
- '**.md'
- '**.MD'
- '.gitignore'
- 'LICENSE'
- 'CODEOWNERS'
- '.github/*.yml'


jobs:
build-app:
name: Build
permissions:
contents: read
packages: write
id-token: write
uses: navikt/sif-gha-workflows/.github/workflows/maven-build-app-db.yml@main
with:
java-version: 21
build-image: ${{ github.ref_name == 'master' }}
push-image: ${{ github.ref_name == 'master' }}
db_schema: pleiepengerbarnuttak_unit
pg_version: 12
secrets: inherit

verdikjede-tester:
name: Verdikjedetester
secrets: inherit
permissions:
id-token: write
contents: write
issues: write
packages: read
uses: navikt/sif-gha-workflows/.github/workflows/verdikjede-test.yml@main
if: github.ref_name == 'master'
needs: build-app
with:
tag: ${{ needs.build-app.outputs.build-version }}


deploy-dev:
name: Deploy dev
permissions:
id-token: write
contents: read
if: github.ref_name == 'master'
needs: [build-app, verdikjede-tester]
uses: navikt/sif-gha-workflows/.github/workflows/maven-deploy.yml@main
with:
gar: true
image: ${{ needs.build-app.outputs.build-version }}
cluster: dev-fss
naiserator_file: nais/dev-fss-k9saksbehandling.yml
secrets: inherit

deploy-prod:
name: Deploy prod
permissions:
id-token: write
contents: read
if: github.ref_name == 'master'
needs: [build-app, verdikjede-tester, deploy-dev]
uses: navikt/sif-gha-workflows/.github/workflows/maven-deploy.yml@main
with:
gar: true
image: ${{ needs.build-app.outputs.build-version }}
cluster: prod-fss
naiserator_file: nais/prod-fss-k9saksbehandling.yml
secrets: inherit
15 changes: 0 additions & 15 deletions .github/workflows/dispatch.yml

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/promote.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/pull-requests.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ class DbTestConfig {
companion object {
// Lazy because we only want it to be initialized when accessed
private val postgres: KPostgreSQLContainer by lazy {
KPostgreSQLContainer("postgres:11.1")
KPostgreSQLContainer("postgres:12.1")
.withDatabaseName("databasename")
.withUsername("postgres")
.withPassword("test")
.withUsername("pleiepengerbarn_unit")
.withPassword("pleiepengerbarn_unit")
}
}
}

// Hack needed because testcontainers use of generics confuses Kotlin
class KPostgreSQLContainer(imageName: String) : PostgreSQLContainer<KPostgreSQLContainer>(imageName)
class KPostgreSQLContainer(imageName: String) : PostgreSQLContainer<KPostgreSQLContainer>(imageName)

0 comments on commit ae868ca

Please sign in to comment.