-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
31 lines (27 loc) · 940 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM mcr.microsoft.com/playwright:v1.47.1 AS playwright
FROM playwright AS playwright-hugo
ARG HUGO_VERSION="0.139.0"
RUN wget --max-redirect=1 -O /tmp/hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz"
RUN tar zxvf /tmp/hugo.tar.gz -C /tmp/
RUN mv /tmp/hugo /usr/bin/
FROM playwright-hugo AS install
WORKDIR /app
COPY .nvmrc package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm \
npm ci --no-update-notifier --no-audit --no-fund
RUN npx playwright install
FROM install AS build
COPY playwright.config.ts config.toml config-dev.toml ./
COPY assets ./assets
COPY build ./build
COPY content ./content
COPY layouts ./layouts
COPY resources ./resources
COPY static ./static
COPY tests ./tests
RUN npm run build
# UI tests are sometimes flaky, so always run them
FROM build AS test
ARG CACHEBUST=1
RUN echo "$CACHEBUST"
RUN npm run test