Skip to content

Commit c4a02e4

Browse files
committed
ci(pipeline): update conditions for build and release steps
- Renames `requires_release` to `requiresRelease` for consistency. - Changes condition to trigger build only if the result is "true". - Adds conditional checks for the release process based on `requiresRelease`. - Ensures that relevant steps for tagging and pushing are executed only during a release.
1 parent 2363274 commit c4a02e4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/pipeline.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
gitVersion_AssemblySemFileVer: ${{ steps.gitversion.outputs.GitVersion_AssemblySemFileVer }}
4545
requiresBuild: ${{ steps.requires_build.outputs.result }}
4646
requiresBuildPush: ${{ steps.requires_build_push.outputs.result }}
47-
requires_release: ${{ steps.requires_release.outputs.result }}
47+
requiresRelease: ${{ steps.requires_release.outputs.result }}
4848
steps:
4949
- name: checkout
5050
uses: actions/checkout@v4
@@ -93,7 +93,7 @@ jobs:
9393
- name: evaluate - requires_build_push
9494
id: requires_build_push
9595
run: |
96-
if [ "${{ steps.requires_build.outputs.result }}" = "false" ]; then
96+
if [ "${{ steps.requires_build.outputs.result }}" = "true" ]; then
9797
result=true
9898
else
9999
result=false
@@ -114,7 +114,7 @@ jobs:
114114
115115
build:
116116
name: build
117-
# if: ${{ needs.discovery.outputs.requiresBuild == 'true' }}
117+
if: ${{ needs.discovery.outputs.requiresBuild == 'true' }}
118118
needs: [discovery]
119119
runs-on: ubuntu-latest
120120
env:
@@ -206,19 +206,22 @@ jobs:
206206
run: helm push .artifacts/helm/${{ env.helmChart }}-${{ env.gitVersion_SemVer }}.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts
207207

208208
- name: docker - tag and push - latest
209+
if: ${{ needs.discovery.outputs.requiresRelease == 'true' }}
209210
run: |
210211
docker buildx imagetools create \
211212
--tag ${{ env.dockerHubContainerImageRepository }}/${{ env.containerImage }}:latest \
212213
--tag ${{ env.ghcrContainerImageRepository }}/${{ env.containerImage }}:latest \
213214
${{ env.ghcrContainerImageRepository }}/${{ env.containerImage }}:${{ env.gitVersion_SemVer }}
214215
215216
- name: oras - push - artifact hub metadata
217+
if: ${{ needs.discovery.outputs.requiresRelease == 'true' }}
216218
run: |
217219
oras push ghcr.io/${{ github.repository_owner }}/helm-charts/${{ env.helmChart }}:artifacthub.io \
218220
--config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
219221
.artifacts/artifacthub/artifacthub-repo.yaml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
220222
221223
- name: github - release - create
224+
if: ${{ needs.discovery.outputs.requiresRelease == 'true' }}
222225
uses: softprops/action-gh-release@v2
223226
with:
224227
repository: ${{ github.repository }}

0 commit comments

Comments
 (0)