Add step in docker file for token
This commit is contained in:
parent
b247926d80
commit
e898095acf
1 changed files with 5 additions and 1 deletions
|
|
@ -5,6 +5,9 @@ FROM mcr.microsoft.com/playwright:v1.48.0-noble
|
|||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
# Accept GitHub token as a build argument
|
||||
ARG GITHUB_TOKEN
|
||||
|
||||
# Copy package.json and package-lock.json
|
||||
COPY package*.json ./
|
||||
|
||||
|
|
@ -14,7 +17,8 @@ RUN npm install
|
|||
# Copy playwright-tests package files + authenticated .npmrc, then install
|
||||
COPY playwright-tests/package*.json ./playwright-tests/
|
||||
COPY playwright-tests/.npmrc ./playwright-tests/
|
||||
RUN cd playwright-tests && npm install
|
||||
RUN --mount=type=secret,id=GITHUB_TOKEN \
|
||||
cd playwright-tests && GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) npm install
|
||||
|
||||
# Install Playwright browsers
|
||||
RUN npx playwright install chromium --with-deps
|
||||
|
|
|
|||
Loading…
Reference in a new issue