Endre navn på Flyway-skript så ting ikke brekker ved deploy #237
Workflow file for this run
This file contains hidden or 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: Build and deploy | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'dependabot/**' | |
| paths-ignore: | |
| - 'dp-inntekt-kontrakter/**' | |
| jobs: | |
| build: | |
| permissions: | |
| contents: "write" | |
| id-token: "write" | |
| name: Build and publish Docker image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - uses: gradle/actions/wrapper-validation@v4 | |
| - uses: gradle/actions/setup-gradle@v4 | |
| id: build | |
| env: | |
| DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS: compileClasspath|runtimeClasspath | |
| ORG_GRADLE_PROJECT_githubUser: x-access-token | |
| ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| dependency-graph: generate-and-submit | |
| cache-encryption-key: ${{ secrets.GradleEncryptionKey }} | |
| - run: ./gradlew --configuration-cache build installDist | |
| - uses: nais/docker-build-push@v0 | |
| name: docker-build-push | |
| id: docker-build-push | |
| with: | |
| team: teamdagpenger | |
| tag: latest | |
| push_image: true # optional, default true | |
| dockerfile: Dockerfile # optional, default Dockerfile | |
| docker_context: . # optional, default . | |
| identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
| project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
| outputs: | |
| image: ${{ steps.docker-build-push.outputs.image }} | |
| deploy-dev: | |
| name: Deploy to dev | |
| needs: [build] | |
| if: github.ref == 'refs/heads/feature/bump-dp-version-catalog' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: "read" | |
| id-token: "write" | |
| environment: dev-gcp | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: nais/deploy/actions/deploy@v2 | |
| env: | |
| CLUSTER: dev-gcp | |
| RESOURCE: nais/dev/nais.yaml | |
| VARS: nais/vars.yaml | |
| VAR: image=${{ needs.build.outputs.image }} | |
| PRINT_PAYLOAD: true | |
| # deploy-prod: | |
| # name: Deploy to Production | |
| # needs: [build, deploy-dev] | |
| # if: github.ref == 'refs/heads/main' | |
| # runs-on: ubuntu-latest | |
| # permissions: | |
| # contents: "read" | |
| # id-token: "write" | |
| # environment: prod-gcp | |
| # steps: | |
| # - uses: actions/checkout@v5 | |
| # - uses: nais/deploy/actions/deploy@v2 | |
| # env: | |
| # CLUSTER: prod-gcp | |
| # RESOURCE: nais/prod/nais.yaml | |
| # VARS: nais/vars.yaml | |
| # VAR: image=${{ needs.build.outputs.image }} | |
| # PRINT_PAYLOAD: true |