Skip to content

Commit a23a27a

Browse files
committed
Fix CI
1 parent d1895d4 commit a23a27a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/app-cloudrun-build.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
SERVICE_PREFIX="${{ inputs.service-name-prefix }}"
6868
BASE_NAME="${{vars.SERVICE_NAME}}"
6969
SENTRY_AUTH_TOKEN=${{secrets.SENTRY_AUTH_TOKEN}}
70+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
7071
# Convert all GitHub vars to build args
7172
BUILD_ARGS=""
7273
for var in $(echo '${{ toJSON(vars) }}' | jq -r 'to_entries | .[] | @base64'); do
@@ -86,6 +87,6 @@ jobs:
8687
echo "Building image with args: $BUILD_ARGS"
8788

8889
IMAGE="${REPO}/${SERVICE_PREFIX:+$SERVICE_PREFIX-}${BASE_NAME}"
89-
eval docker build -t ${IMAGE}:${SHA} . --file ${{ inputs.dockerfile }} ${BUILD_ARGS}
90+
eval docker build -t ${IMAGE}:${SHA} . --file ${{ inputs.dockerfile }} --secret github_token=${GITHUB_TOKEN} ${BUILD_ARGS}
9091
docker push ${IMAGE}:${SHA}
9192
echo "image_tag=${IMAGE}:${SHA}" >> $GITHUB_OUTPUT

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ WORKDIR /app
88
# Copy package files for dependency installation
99
COPY package.json package-lock.json* ./
1010

11-
# Install dependencies
12-
RUN npm install --no-audit --no-fund
11+
# Install dependencies with GitHub token authentication
12+
RUN --mount=type=secret,id=github_token \
13+
npm config set @tokens-studio:registry https://npm.pkg.github.com && \
14+
npm config set //npm.pkg.github.com/:_authToken=$(cat /run/secrets/github_token) && \
15+
npm install --no-audit --no-fund
1316

1417
# Copy source files
1518
COPY . .

0 commit comments

Comments
 (0)