Skrur på nytt dsop-format i produksjon (#844) #847
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: Bygg og deploy | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| cluster: | |
| description: Cluster | |
| required: true | |
| default: dev-gcp | |
| type: choice | |
| options: | |
| - dev-gcp | |
| - prod-gcp | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '.github/**' | |
| - '*.md' | |
| - 'CODEOWNERS' | |
| jobs: | |
| gradle: | |
| permissions: | |
| contents: write | |
| actions: read | |
| checks: write | |
| id-token: write | |
| uses: navikt/aap-workflows/.github/workflows/gradle-build.yml@main | |
| secrets: inherit | |
| publiser-kontrakt: | |
| needs: gradle | |
| concurrency: kontrakt | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| # Ha denne tidlig, så action kan skippe raskt om ingen endringer. | |
| - uses: paulhatch/semantic-version@9f72830310d5ed81233b641ee59253644cd8a8fc # v6.0.2 | |
| id: tag | |
| with: | |
| change_path: "kontrakt/" | |
| bump_each_commit: true | |
| tag_prefix: "" | |
| bump_each_commit_patch_pattern: '' | |
| major_pattern: "(MAJOR)" # If major bump, include this in commit message | |
| - uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0 | |
| if: ${{ steps.tag.outputs.changed == 'true' }} | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 | |
| with: | |
| gradle-version: wrapper | |
| - id: notes | |
| if: ${{ steps.tag.outputs.changed == 'true' }} | |
| run: | | |
| randomDelimiter=${RANDOM} | |
| text=$(git --no-pager log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s") | |
| echo 'CHANGELOG<<$randomDelimiter' >> $GITHUB_OUTPUT | |
| echo $text >> $GITHUB_OUTPUT | |
| echo '$randomDelimiter' >> $GITHUB_OUTPUT | |
| - uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1 | |
| if: ${{ steps.tag.outputs.changed == 'true' }} | |
| id: create_release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.tag.outputs.version }} | |
| name: ${{ steps.tag.outputs.version }} | |
| body: | | |
| Endringer siden sist: | |
| ${{ steps.notes.outputs.CHANGELOG }} | |
| - if: ${{ steps.tag.outputs.changed == 'true' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| ./gradlew -Pversion=${{ steps.tag.outputs.version }} publish | |
| topic-dev: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| needs: gradle | |
| concurrency: | |
| group: deploy-topic-dev | |
| uses: navikt/aap-workflows/.github/workflows/deploy.yml@main | |
| secrets: inherit | |
| with: | |
| cluster: dev-gcp | |
| manifest: .nais/topic-dev.yaml | |
| dev: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| needs: [ gradle, topic-dev ] | |
| concurrency: | |
| group: deploy-dev | |
| uses: navikt/aap-workflows/.github/workflows/deploy.yml@main | |
| secrets: inherit | |
| with: | |
| cluster: dev-gcp | |
| manifest: .nais/app-dev.yml | |
| topic-prod: | |
| if: ${{ github.ref == 'refs/heads/main' || github.event.inputs.cluster == 'prod-gcp' }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| needs: [ publiser-kontrakt, dev ] | |
| concurrency: | |
| group: deploy-topic-prod | |
| uses: navikt/aap-workflows/.github/workflows/deploy.yml@main | |
| secrets: inherit | |
| with: | |
| cluster: prod-gcp | |
| manifest: .nais/topic-prod.yaml | |
| prod: | |
| if: ${{ github.ref == 'refs/heads/main' || github.event.inputs.cluster == 'prod-gcp' }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| needs: [ publiser-kontrakt, dev, topic-prod ] | |
| concurrency: | |
| group: deploy-prod | |
| uses: navikt/aap-workflows/.github/workflows/deploy.yml@main | |
| secrets: inherit | |
| with: | |
| cluster: prod-gcp | |
| manifest: .nais/app-prod.yml |