-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from wavezync/upgrade-node-v
chore: migrate to pnpm
- Loading branch information
Showing
8 changed files
with
9,882 additions
and
25,949 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 |
---|---|---|
|
@@ -17,10 +17,6 @@ concurrency: | |
group: "build-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
env: | ||
DOKKU_HOST: ssh://[email protected]:22 | ||
DOKKU_APP: staging-ab-api | ||
|
||
jobs: | ||
# Build job | ||
build: | ||
|
@@ -37,6 +33,10 @@ jobs: | |
echo "command=install" >> $GITHUB_OUTPUT | ||
echo "runner=yarn" >> $GITHUB_OUTPUT | ||
exit 0 | ||
elif [ -f "${{ github.workspace }}/pnpm-lock.yaml" ]; then | ||
echo "manager=pnpm" >> $GITHUB_OUTPUT | ||
echo "command=install --frozen-lockfile" >> $GITHUB_OUTPUT | ||
echo "runner=pnpm" >> $GITHUB_OUTPUT | ||
elif [ -f "${{ github.workspace }}/package.json" ]; then | ||
echo "manager=npm" >> $GITHUB_OUTPUT | ||
echo "command=ci" >> $GITHUB_OUTPUT | ||
|
@@ -46,10 +46,16 @@ jobs: | |
echo "Unable to determine packager manager" | ||
exit 1 | ||
fi | ||
- name: Setup pnpm | ||
if: steps.detect-package-manager.outputs.manager == 'pnpm' | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 9 | ||
run_install: false | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
node-version: "20" | ||
cache: ${{ steps.detect-package-manager.outputs.manager }} | ||
- name: Install dependencies | ||
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
shamefully-hoist=true |
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,27 +1,23 @@ | ||
FROM node:16-alpine as development | ||
FROM node:20-alpine AS base | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
ENV HUSKY=0 | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
|
||
# Bundle app source | ||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
FROM node:16-alpine as production | ||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
RUN npm install --only=production | ||
FROM base AS build | ||
WORKDIR /app | ||
COPY .npmrc pnpm-lock.yaml package.json ./ | ||
RUN --mount=type=secret,id=npmrc,target=/root/.npmrc pnpm install --frozen-lockfile | ||
COPY . . | ||
RUN pnpm build | ||
|
||
COPY --from=development /usr/src/app/dist ./dist | ||
FROM base AS prod | ||
WORKDIR /app | ||
ENV NODE_ENV=production | ||
COPY .npmrc pnpm-lock.yaml package.json Procfile nest-cli.json ./ | ||
RUN --mount=type=secret,id=npmrc,target=/root/.npmrc pnpm install --frozen-lockfile --prod | ||
COPY --from=build /app/dist ./dist | ||
|
||
CMD [ "npm", "run" , "start:prod" ] | ||
EXPOSE 3000 | ||
CMD ["pnpm", "start:prod"] |
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
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
Oops, something went wrong.