|
11 | 11 | description: 'Custom run command for the Build and Deploy step (overrides default Maven command)' |
12 | 12 | required: false |
13 | 13 | type: string |
14 | | - custom_build_action: |
15 | | - description: 'Custom action reference for build/test (e.g., ./.github/actions/build-and-test or org/repo/.github/actions/name@ref)' |
16 | | - required: false |
17 | | - type: string |
18 | | - custom_build_action_inputs: |
19 | | - description: 'JSON string of inputs to pass to custom build action' |
20 | | - required: false |
21 | | - type: string |
22 | | - custom_deploy_command: |
23 | | - description: 'Custom deploy command to run after custom build action when SHOULD_DEPLOY is true' |
24 | | - required: false |
25 | | - type: string |
26 | 14 | runs_on: |
27 | 15 | description: 'Runner to use for the build job (defaults to ubuntu-latest)' |
28 | 16 | required: false |
@@ -138,40 +126,22 @@ jobs: |
138 | 126 | echo "SHOULD_DEPLOY=$SHOULD_DEPLOY" >> $GITHUB_ENV |
139 | 127 | echo "Build configuration: BUILD_WITH_DOCS=$BUILD_WITH_DOCS, SHOULD_DEPLOY=$SHOULD_DEPLOY" |
140 | 128 |
|
141 | | - - name: Custom build action |
142 | | - if: ${{ inputs.custom_build_action != '' }} |
143 | | - uses: ${{ inputs.custom_build_action }} |
144 | | - with: |
145 | | - java-version: ${{ matrix.java-version }} |
146 | | - inputs: ${{ inputs.custom_build_action_inputs }} |
147 | | - |
148 | | - - name: Custom deploy command |
149 | | - if: ${{ inputs.custom_build_action != '' && inputs.custom_deploy_command != '' && env.SHOULD_DEPLOY == 'true' }} |
150 | | - env: |
151 | | - CUSTOM_DEPLOY_COMMAND: ${{ inputs.custom_deploy_command }} |
152 | | - run: | |
153 | | - # Execute custom deploy command after custom build action |
154 | | - echo "Running custom deploy command" |
155 | | - printf '%s\n' "$CUSTOM_DEPLOY_COMMAND" > /tmp/custom-deploy.sh |
156 | | - chmod +x /tmp/custom-deploy.sh |
157 | | - bash /tmp/custom-deploy.sh |
158 | | -
|
159 | 129 | - name: Build |
160 | | - if: ${{ inputs.custom_build_action == '' && inputs.custom_build_command == '' && env.SHOULD_DEPLOY == 'false' }} |
| 130 | + if: ${{ inputs.custom_build_command == '' && env.SHOULD_DEPLOY == 'false' }} |
161 | 131 | run: | |
162 | 132 | # Run Maven install for non-deploying JDK versions (no docs profile needed) |
163 | 133 | echo "Building without deployment" |
164 | 134 | ./mvnw clean install -Pspring -B -U |
165 | 135 |
|
166 | 136 | - name: Build and deploy |
167 | | - if: ${{ inputs.custom_build_action == '' && inputs.custom_build_command == '' && env.SHOULD_DEPLOY == 'true' }} |
| 137 | + if: ${{ inputs.custom_build_command == '' && env.SHOULD_DEPLOY == 'true' }} |
168 | 138 | run: | |
169 | 139 | # Run Maven deploy for the designated JDK version (always includes docs profile) |
170 | 140 | echo "Building with docs profile and deploying artifacts" |
171 | 141 | ./mvnw clean deploy -Pdocs,deploy,spring -B -U |
172 | 142 |
|
173 | 143 | - name: Custom build command |
174 | | - if: ${{ inputs.custom_build_action == '' && inputs.custom_build_command != '' }} |
| 144 | + if: ${{ inputs.custom_build_command != '' }} |
175 | 145 | env: |
176 | 146 | CUSTOM_BUILD_COMMAND: ${{ inputs.custom_build_command }} |
177 | 147 | run: | |
|
0 commit comments