Skip to content

Commit

Permalink
CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
M397749490 committed Nov 27, 2024
1 parent 3715a62 commit a319779
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ jobs:
port: ${{ secrets.SSH_PORT }}
script: |
cd ${{ secrets.PROJECT_PATH }}
sudo bash ./deploy.sh
sudo bash ./deploy.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,4 @@ dist

.idea/
.vscode/
.env
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Using this system, KLPBBS users can quickly log in using their KLPBBS account wi

## License

This project is licensed under the MIT license, please refer to [LICENSE](./LICENSE) for details
This project is licensed under the MIT license, please refer to [LICENSE](./LICENSE) for details

## Contribute

Expand Down
21 changes: 5 additions & 16 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
FROM node:18-alpine AS base
# syntax=docker.io/docker/dockerfile:1

FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app

COPY package.json yarn.lock ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi
FROM node:23-alpine AS base

FROM base AS builder
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

RUN \
if [ -f yarn.lock ]; then yarn run build; \
else echo "Lockfile not found." && exit 1; \
fi
COPY . .
RUN corepack enable yarn && yarn --frozen-lockfile && yarn run build

FROM base AS runner
WORKDIR /app
Expand Down

0 comments on commit a319779

Please sign in to comment.