diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..19f2084 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM node:12-buster as builder +WORKDIR /app +COPY package.json yarn.lock ./ +RUN export YARN_CACHE_FOLDER="$(mktemp -d)" \ + && yarn install --frozen-lockfile --quiet \ + && rm -r "$YARN_CACHE_FOLDER" +COPY . . +RUN yarn build + +FROM node:12-buster +COPY --from=builder /app/package.json /app/yarn.lock /action-release/ +RUN export YARN_CACHE_FOLDER="$(mktemp -d)" \ + && cd /action-release \ + && yarn install --frozen-lockfile --production --quiet \ + && rm -r "$YARN_CACHE_FOLDER" + + +COPY --from=builder /app/dist /action-release/dist/ +RUN chmod +x /action-release/dist/index.js +#RUN ln -s /action-release/dist/index.js ./dist/index.js + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml index 40114bb..7355f16 100644 --- a/action.yml +++ b/action.yml @@ -15,8 +15,8 @@ inputs: description: 'Unix timestamp ' required: false runs: - using: 'node12' - main: 'dist/index.js' + using: 'docker' + image: 'Dockerfile' branding: icon: 'triangle' color: 'purple' diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..1705811 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/sh -l +node /action-release/dist/index.js