Bump actions/setup-java from ead9eaa3cfe0b0fc2fa749519ae09c3d4f4080b0 to 66b945764b75604b3cfd644c3ada5232cf6c90c6 #275
Workflow file for this run
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: "Build" | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - develop | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| tests: | |
| name: Tests | |
| uses: ./.github/workflows/test.yml | |
| permissions: | |
| contents: read | |
| generate-build-id: | |
| name: "Generate Build Id" | |
| needs: [ tests ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| build-id: ${{ steps.generate.outputs.buildId }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - id: generate | |
| working-directory: ./scripts | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| chmod +x ./create_build_id.sh | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| GIT_BRANCH=PR | |
| elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/develop" ]]; then | |
| GIT_BRANCH=develop | |
| fi | |
| BUILD_ID=$(./create_build_id.sh $GIT_BRANCH ${{ github.run_number }} ${{ github.sha }}) | |
| echo "Generated the build tag: $BUILD_ID" | |
| echo "buildId=$BUILD_ID" >> "$GITHUB_OUTPUT" | |
| publish-docker-image: | |
| name: "Publish docker image to ECR" | |
| needs: [ generate-build-id ] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| uses: ./.github/workflows/publish.yml | |
| with: | |
| build-id: ${{ needs.generate-build-id.outputs.build-id }} | |
| secrets: inherit | |
| comment: | |
| if: github.event_name == 'pull_request' | |
| name: "Create Build ID Comment" | |
| needs: [ generate-build-id, publish-docker-image] | |
| continue-on-error: true | |
| permissions: | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Comment PR | |
| uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1 | |
| with: | |
| message: | | |
| Images built and published to ECR using a Build Id of ${{ needs.generate-build-id.outputs.build-id }} | |
| comment-tag: images-built | |
| mode: upsert |