Skip to content

Commit

Permalink
attempt to build using boot
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Orlov committed Aug 20, 2024
1 parent 8c3c71e commit 31b3375
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 48 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/docker-image.yml

This file was deleted.

39 changes: 37 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,56 @@ on:
pull_request:
branches: [ "master" ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build with Maven
run: ./mvnw -B package spring-boot:build-image --file pom.xml -Dspring-boot.build-image.imageName=${{ steps.meta.outputs.tags }}

- name: Build with Maven
run: mvn -B package --file pom.xml
run: docker push ${{ steps.meta.outputs.tags }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
Expand Down

0 comments on commit 31b3375

Please sign in to comment.