GAR push og pull #1457
This file contains 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: | |
push: | |
branches: | |
- '**' | |
paths-ignore: | |
- '**.md' | |
- '**.MD' | |
- '.gitignore' | |
- '.editorconfig' | |
- '.java-version' | |
- '.gitattributes' | |
- 'LICENSE' | |
- 'CODEOWNERS' | |
- 'docs/**' | |
- 'lokalutvikling/**' | |
- '.devcontainer/**' | |
- '.github/*.yml' | |
jobs: | |
build-app: | |
name: Build | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
uses: navikt/fp-gha-workflows/.github/workflows/build-app-postgres.yml@main | |
with: | |
postgres-user: fpabakus_unit | |
build-image: ${{ github.ref_name == 'master' }} # default: true | |
push-image: ${{ github.ref_name == 'master' }} # default: false | |
secrets: inherit | |
release-drafter: | |
name: Update | |
if: github.ref_name == 'master' | |
needs: build-app | |
permissions: | |
contents: write | |
pull-requests: read | |
uses: navikt/fp-gha-workflows/.github/workflows/release-drafter.yml@main | |
secrets: inherit | |
trigger-autotest-k9: | |
name: Autotest K9 | |
if: github.ref_name == 'master' | |
needs: build-app | |
runs-on: ubuntu-latest | |
steps: | |
- uses: navikt/github-app-token-generator@v1 | |
id: get-token | |
with: | |
private-key: ${{ secrets.FP_PRIVATE_KEY }} # Erstatt med K9SAKSBEHANDLING_PRIVATE_KEY | |
app-id: ${{ secrets.FP_APP_ID }} # Erstatt med K9SAKSBEHANDLING_APP_ID | |
- name: Trigger verdikjede test | |
shell: bash | |
run: | | |
curl -XPOST -u "x-access-token:${{ steps.get-token.outputs.token }}" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/navikt/k9-verdikjede/actions/workflows/build.yml/dispatches \ | |
-d '{"ref":"master", | |
"inputs":{ | |
"trigger": "${{ github.repository }}", | |
"version": "${{ needs.build-app.outputs.build-version }}" | |
}}' | |
fpsak-tester: | |
name: Fpsak tester | |
if: github.ref_name == 'master' | |
needs: build-app | |
uses: navikt/fp-autotest/.github/workflows/autotest.yml@master | |
with: | |
build-version: ${{ needs.build-app.outputs.build-version }} | |
test-suite: fpsak | |
verdikjede-tester: | |
name: Verdikjedetester | |
if: github.ref_name == 'master' | |
needs: build-app | |
uses: navikt/fp-autotest/.github/workflows/autotest.yml@master | |
with: | |
build-version: ${{ needs.build-app.outputs.build-version }} | |
test-suite: verdikjede | |
notify: | |
name: Notify | |
if: github.ref_name == 'master' && (success() || failure()) && !contains(needs.*.result, 'skipped') | |
needs: [build-app, fpsak-tester, verdikjede-tester] | |
uses: navikt/fp-autotest/.github/workflows/report-and-notify.yml@master | |
with: | |
fpsak: ${{ needs.fpsak-tester.outputs.resultat }} | |
verdikjede: ${{ needs.verdikjede-tester.outputs.resultat }} | |
build-version: ${{ needs.build-app.outputs.build-version }} | |
secrets: inherit | |
deploy-dev: | |
name: Deploy dev | |
permissions: | |
id-token: write | |
if: github.ref_name == 'master' | |
needs: [build-app, fpsak-tester, verdikjede-tester] | |
uses: navikt/fp-gha-workflows/.github/workflows/deploy.yml@main | |
with: | |
gar: true | |
image: ${{ needs.build-app.outputs.build-version }} | |
cluster: dev-fss | |
secrets: inherit | |
deploy-prod: | |
name: Deploy prod | |
permissions: | |
id-token: write | |
if: github.ref_name == 'master' | |
needs: [build-app, fpsak-tester, verdikjede-tester, deploy-dev] | |
uses: navikt/fp-gha-workflows/.github/workflows/deploy.yml@main | |
with: | |
gar: true | |
image: ${{ needs.build-app.outputs.build-version }} | |
cluster: prod-fss | |
secrets: inherit | |