Skip to content

sandbox instead of stage cn #75

sandbox instead of stage cn

sandbox instead of stage cn #75

Workflow file for this run

# This is the main file that defines the CI pipeline for the project using GitHub Actions.
name: CI Pipeline
on:
workflow_dispatch:
push:
branches:
- "main"
- "develop"
- "feature-*"
- "bugfix-*"
tags:
- '*.*.*'
permissions:
contents: write
packages: write
security-events: write
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
helm_changed: ${{ steps.detect.outputs.helm_changed }}
non_helm_changed: ${{ steps.detect.outputs.non_helm_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # Fetch enough history so prev. commit will be found
- name: Detect changes in helm/ and outside helm/
id: detect
run: |
if git diff --quiet ${{ github.event.before }} ${{ github.sha }} -- helm/; then
echo "helm_changed=false" >> $GITHUB_OUTPUT
else
echo "helm_changed=true" >> $GITHUB_OUTPUT
fi
if git diff --quiet ${{ github.event.before }} ${{ github.sha }} -- . ':!helm/'; then
echo "non_helm_changed=false" >> $GITHUB_OUTPUT
else
echo "non_helm_changed=true" >> $GITHUB_OUTPUT
fi
maven-build:
uses: ./.github/workflows/maven-build.yaml
needs: [detect-changes]
# Don't need to run maven-build if these are helm-only changes
if: needs.detect-changes.outputs.non_helm_changed == 'true'
docker-publish:
uses: ./.github/workflows/docker-publish.yaml
needs: [maven-build, detect-changes]
# Don't need to run docker-publish if these are helm-only changes or a helm-only tag
if: needs.detect-changes.outputs.non_helm_changed == 'true' &&
(github.ref_name == 'develop' || (startsWith(github.ref, 'refs/tags/') &&
!startsWith(github.ref, 'refs/tags/chart-')))
with:
version: ${{ needs.maven-build.outputs.version }}
helm-publish:
uses: ./.github/workflows/helm-publish.yaml
needs: [detect-changes]
# Only publish if Helm changed, and we're on develop or a chart-* tag
if: needs.detect-changes.outputs.helm_changed == 'true' &&
(github.ref_name == 'develop' || startsWith(github.ref, 'refs/tags/chart-'))