File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 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
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
Original file line number Diff line number Diff line change @@ -8,8 +8,11 @@ WORKDIR /app
88# Copy package files for dependency installation
99COPY 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
1518COPY . .
You can’t perform that action at this time.
0 commit comments