Skip to content

Commit 0748f20

Browse files
committed
Add NPM Azure Key support for platform-ui Docker build and update workflow reference
Signed-off-by: Vaibhav Gadre <vgadre@progress.com>
1 parent df77bd9 commit 0748f20

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

.github/workflows/build-docker-image.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
id: build-image
6060
env:
6161
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
62+
# WARNING: This workflow accesses a non-default secret. Ensure this secret is
63+
# required and that it is stored securely in the repository or organization settings.
64+
NPM_AZURE_KEY: ${{ secrets.NPM_AZURE_KEY }}
6265
run: |
6366
if [ ! -f "Dockerfile" ]; then
6467
echo "❌ No Dockerfile found - cannot build"
@@ -68,8 +71,25 @@ jobs:
6871
echo "Building Docker image..."
6972
REPO_NAME=$(basename $(pwd))
7073
74+
# Strategy 0: platform-ui - build with NPM Azure Key via buildx secret
75+
if [ "${{ github.event.repository.name }}" = "platform-ui" ]; then
76+
echo "Detected platform-ui - building with NPM Azure Key secret"
77+
trap 'rm -f .npmrc.tmp' EXIT
78+
printf '%s' "$NPM_AZURE_KEY" > .npmrc.tmp
79+
docker buildx create --use
80+
docker buildx build \
81+
--secret id=npmrc,src=.npmrc.tmp \
82+
--load \
83+
--platform linux/amd64 \
84+
--build-arg GITHUB_TOKEN="$GITHUB_TOKEN" \
85+
--build-arg GIT_SHA="${{ github.sha }}" \
86+
--build-arg APP_VERSION="${{ github.ref_name }}" \
87+
--build-arg DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
88+
-t "${REPO_NAME}:latest" .
89+
IMAGES="${REPO_NAME}:latest"
90+
7191
# Strategy 1: Check for build-docker.sh script (e.g., dsm-erchef)
72-
if [ -f "build-docker.sh" ]; then
92+
elif [ -f "build-docker.sh" ]; then
7393
echo "Found build-docker.sh script - using it to build images"
7494
chmod +x build-docker.sh
7595
GITHUB_TOKEN="${{ secrets.GH_TOKEN }}" ./build-docker.sh

.github/workflows/ci-main-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ jobs:
10291029
build-docker-image:
10301030
name: 'Build Docker image for security scans'
10311031
if: ${{ inputs.perform-grype-image-scan == true || inputs.perform-wiz-scan == true }}
1032-
uses: chef/common-github-actions/.github/workflows/build-docker-image.yml@main
1032+
uses: chef/common-github-actions/.github/workflows/build-docker-image.yml@vaibhav/CHEF-33431-platform-ui-docker-build-fix
10331033
needs: checkout
10341034
secrets: inherit
10351035
with:

0 commit comments

Comments
 (0)