-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ahmad Nassri
committed
Sep 5, 2022
1 parent
85a6aa0
commit 9f69c1f
Showing
2 changed files
with
25 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,40 @@ | ||
FROM node:18-slim | ||
# --- base stage --- # | ||
|
||
LABEL com.github.actions.name="Conventional Semantic Release" \ | ||
com.github.actions.description="Semantic Release with all the presets" \ | ||
com.github.actions.icon="package" \ | ||
com.github.actions.color="red" \ | ||
maintainer="Ahmad Nassri <ahmad@ahmadnassri.com>" | ||
FROM alpine:3.16 AS base | ||
|
||
# hadolint ignore=DL3018 | ||
RUN apk add --no-cache --update nodejs npm git openssh ca-certificates ruby-bundler | ||
|
||
RUN git config --global --add safe.directory /github/workspace | ||
|
||
# set working dir | ||
RUN mkdir /action | ||
WORKDIR /action | ||
|
||
ENTRYPOINT [ "node" ] | ||
|
||
# --- build stage --- # | ||
|
||
FROM base AS build | ||
|
||
# slience npm | ||
# hadolint ignore=DL3059 | ||
RUN npm config set update-notifier=false audit=false fund=false | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends git openssh-client ca-certificates ruby-full \ | ||
&& apt-get purge -y --auto-remove \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& gem install bundler | ||
# keyscan github.com | ||
RUN mkdir -p ~/.ssh && ssh-keyscan github.com >> /root/.ssh/known_hosts | ||
|
||
# install packages | ||
COPY action/package* ./ | ||
RUN npm ci --omit=dev --no-fund --no-audit | ||
|
||
# keyscan github.com | ||
RUN mkdir -p ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
# --- app stage --- # | ||
|
||
FROM base AS app | ||
|
||
# copy from build image | ||
COPY --from=build /root/.ssh/known_hosts /root/.ssh/known_hosts | ||
COPY --from=build /action/node_modules ./node_modules | ||
|
||
# copy files | ||
COPY action ./ | ||
|
||
# set entry point | ||
ENTRYPOINT ["node", "--no-warnings=ExperimentalWarnings", "/action/index.js"] | ||
CMD ["--no-warnings=ExperimentalWarnings", "/action/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
"release" | ||
], | ||
"engines": { | ||
"node": ">=18" | ||
"node": ">=16" | ||
}, | ||
"main": "index.js", | ||
"type": "module", | ||
|