Skip to content
16 changes: 15 additions & 1 deletion .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,22 @@ jobs:
echo "Building Docker image..."
REPO_NAME=$(basename $(pwd))

# Strategy 0: platform-ui — delegate entirely to build-docker.sh which handles
# submodule checkout (PAT), NPM Azure Key secret, and docker buildx build.
if [ "${{ github.event.repository.name }}" = "platform-ui" ]; then
echo "Detected platform-ui - delegating to build-docker.sh"
chmod +x build-docker.sh
GITHUB_TOKEN="${{ secrets.GH_TOKEN }}" \
NPM_AZURE_KEY="${{ secrets.NPM_AZURE_KEY }}" \
BRANCH_NAME="${{ github.head_ref || github.ref_name }}" \
GIT_SHA="${{ github.sha }}" \
APP_VERSION="${{ github.ref_name }}" \
LOCALES="en" \
./build-docker.sh
IMAGES=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep -E "^${REPO_NAME}" | grep -v "^<none>")

# Strategy 1: Check for build-docker.sh script (e.g., dsm-erchef)
if [ -f "build-docker.sh" ]; then
elif [ -f "build-docker.sh" ]; then
echo "Found build-docker.sh script - using it to build images"
chmod +x build-docker.sh
GITHUB_TOKEN="${{ secrets.GH_TOKEN }}" ./build-docker.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-main-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ jobs:
run-grype-image:
name: 'Grype Docker image scan'
if: ${{ inputs.perform-grype-image-scan }}
uses: chef/common-github-actions/.github/workflows/grype.yml@main
uses: chef/common-github-actions/.github/workflows/grype.yml@vaibhav/CHEF-33431-platform-ui-docker-build-fix
needs: [checkout, build-docker-image]
secrets: inherit
with:
Expand All @@ -1029,7 +1029,7 @@ jobs:
build-docker-image:
name: 'Build Docker image for security scans'
if: ${{ inputs.perform-grype-image-scan == true || inputs.perform-wiz-scan == true }}
uses: chef/common-github-actions/.github/workflows/build-docker-image.yml@main
uses: chef/common-github-actions/.github/workflows/build-docker-image.yml@vaibhav/CHEF-33431-platform-ui-docker-build-fix
needs: checkout
secrets: inherit
with:
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/grype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,22 @@ jobs:
echo "Building Docker image..."
REPO_NAME=$(basename $(pwd))

# Strategy 0: platform-ui — delegate entirely to build-docker.sh which handles
# submodule checkout (PAT), NPM Azure Key secret, and docker buildx build.
if [ "${{ github.event.repository.name }}" = "platform-ui" ]; then
echo "Detected platform-ui - delegating to build-docker.sh"
chmod +x build-docker.sh
GITHUB_TOKEN="${{ secrets.GH_TOKEN }}" \
NPM_AZURE_KEY="${{ secrets.NPM_AZURE_KEY }}" \
BRANCH_NAME="${{ github.head_ref || github.ref_name }}" \
GIT_SHA="${{ github.sha }}" \
APP_VERSION="${{ github.ref_name }}" \
LOCALES="en" \
./build-docker.sh
IMAGES=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep -E "^${REPO_NAME}" | grep -v "^<none>")

# Strategy 1: Check for build-docker.sh script (e.g., dsm-erchef)
if [ -f "build-docker.sh" ]; then
elif [ -f "build-docker.sh" ]; then
echo "Found build-docker.sh script - using it to build images"
chmod +x build-docker.sh
GITHUB_TOKEN="${{ secrets.GH_TOKEN }}" ./build-docker.sh
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/wiz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,22 @@ jobs:
echo "Building Docker image..."
REPO_NAME=$(basename $(pwd))

# Strategy 0: platform-ui — delegate entirely to build-docker.sh which handles
# submodule checkout (GITHUB_TOKEN), NPM Azure Key secret, and docker buildx build.
if [ "${{ github.event.repository.name }}" = "platform-ui" ]; then
echo "Detected platform-ui - delegating to build-docker.sh"
chmod +x build-docker.sh
GITHUB_TOKEN="${{ secrets.GH_TOKEN }}" \
NPM_AZURE_KEY="${{ secrets.NPM_AZURE_KEY }}" \
BRANCH_NAME="${{ github.head_ref || github.ref_name }}" \
GIT_SHA="${{ github.sha }}" \
APP_VERSION="${{ github.ref_name }}" \
LOCALES="en" \
./build-docker.sh
IMAGES=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep -E "^${REPO_NAME}" | grep -v "^<none>")

# Strategy 1: Check for build-docker.sh script (e.g., dsm-erchef)
if [ -f "build-docker.sh" ]; then
elif [ -f "build-docker.sh" ]; then
echo "Found build-docker.sh script - using it to build images"
chmod +x build-docker.sh
GITHUB_TOKEN="${{ secrets.GH_TOKEN }}" ./build-docker.sh
Expand Down