BE: Fix spring boot build info population (#901) #197
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: "Main: Build & deploy" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| jar-build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| version: ${{steps.build.outputs.version}} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| token: ${{ github.token }} | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'zulu' | |
| cache: 'gradle' | |
| - name: Build jar | |
| id: build | |
| run: | | |
| version=${GITHUB_SHA::7} | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| ./gradlew clean build \ | |
| -x test \ | |
| -Pinclude-frontend=true \ | |
| -Pversion=$version | |
| - name: Upload jar | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kafbat-ui-${{ steps.build.outputs.version }} | |
| path: api/build/libs/api-${{ steps.build.outputs.version }}.jar | |
| retention-days: 1 | |
| docker-build: | |
| needs: jar-build | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/docker_build.yml | |
| secrets: inherit | |
| with: | |
| sha: ${{ github.sha }} | |
| version: ${{ needs.jar-build.outputs.version }} | |
| docker-deploy: | |
| needs: [ jar-build, docker-build ] | |
| permissions: | |
| packages: write | |
| id-token: write # Required to authenticate with OIDC for AWS | |
| uses: ./.github/workflows/docker_publish.yml | |
| secrets: inherit | |
| with: | |
| version: ${{ needs.jar-build.outputs.version }} | |
| generic_tag: main |