Merge branch 'master' into jwt-groups #1529
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 | |
on: | |
push: | |
branches: | |
- '**' | |
paths-ignore: | |
- '**.md' | |
- '**.MD' | |
- '.gitignore' | |
- '.editorconfig' | |
- '.java-version' | |
- '.project' | |
- 'LICENSE' | |
- 'CODEOWNERS' | |
- 'docs/**' | |
- '.github/*.yml' | |
jobs: | |
build-app: | |
name: Build | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
uses: navikt/fp-gha-workflows/.github/workflows/build-app-no-db.yml@main | |
with: | |
build-image: ${{ github.ref_name == 'master' }} # default: true | |
push-image: ${{ github.ref_name == 'master' }} # default: false | |
sonar-scan: true | |
use-reader: true | |
secrets: inherit | |
build-push-docker-image-ghcr: | |
name: Build og push til ghcr | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-latest | |
needs: build-app | |
if: github.ref_name == 'master' | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 | |
- name: Setup java and maven | |
uses: navikt/fp-gha-workflows/.github/actions/setup-java-and-maven@main # ratchet:exclude | |
with: | |
github-token: ${{ (github.actor != 'dependabot[bot]' && secrets.READER_TOKEN) || secrets.GITHUB_TOKEN }} | |
- name: Maven install and test | |
id: build-and-test | |
uses: navikt/fp-gha-workflows/.github/actions/build-maven-application@main # ratchet:exclude | |
with: | |
skip-tests: 'true' | |
- name: Login to GitHub Packages Docker Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # ratchet:docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # ratchet:docker/setup-buildx-action@v2 | |
- name: Docker meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # ratchet:docker/metadata-action@v4 | |
id: meta | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: type=raw,value=latest,enable={{is_default_branch}} | |
- name: Bygg og push docker image | |
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # ratchet:docker/build-push-action@v4 | |
id: build_push | |
with: | |
context: "." | |
file: "Dockerfile" | |
platforms: "linux/amd64" | |
pull: true | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
release-drafter: | |
name: Update | |
permissions: | |
contents: write | |
pull-requests: read | |
if: github.ref_name == 'master' | |
needs: build-app | |
uses: navikt/fp-gha-workflows/.github/workflows/release-drafter.yml@main | |
secrets: inherit |