forked from danger/danger-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (22 loc) · 840 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
FROM node:18-slim as base
LABEL maintainer="Orta Therox"
LABEL "com.github.actions.name"="Danger JS Action"
LABEL "com.github.actions.description"="Runs JavaScript/TypeScript Dangerfiles"
LABEL "com.github.actions.icon"="zap"
LABEL "com.github.actions.color"="blue"
WORKDIR /usr/src/danger
FROM base as build
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
RUN yarn run build:fast
RUN yarn remove 'typescript' --dev && yarn add 'typescript'
RUN yarn install --production --frozen-lockfile
RUN chmod +x distribution/commands/danger.js
FROM base
ENV PATH="/usr/src/danger/node_modules/.bin:$PATH"
COPY package.json ./
COPY --from=build /usr/src/danger/distribution ./dist
COPY --from=build /usr/src/danger/node_modules ./node_modules
RUN ln -s /usr/src/danger/dist/commands/danger.js /usr/bin/danger
ENTRYPOINT ["danger", "ci"]