File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,26 +19,18 @@ jobs:
1919 - name : Checkout
2020 uses : actions/checkout@v4
2121
22- - name : Setup Bun
23- uses : oven-sh/setup-bun@v2
24- with :
25- bun-version : latest
26-
27- - name : Install dependencies
28- run : bun install --frozen-lockfile
29-
30- - name : Build
31- run : bun run build
32-
33- - name : Sync build artifacts to deploy path
22+ - name : Sync source to deploy path
3423 run : |
3524 mkdir -p "$DEPLOY_PATH"
36- rsync -a --delete dist/ "$DEPLOY_PATH/"
37- cp Dockerfile "$DEPLOY_PATH/Dockerfile"
25+ rsync -a --delete \
26+ --exclude=node_modules \
27+ --exclude=.git \
28+ --exclude=dist \
29+ ./ "$DEPLOY_PATH/"
3830
3931 - name : Build Docker image
4032 working-directory : ${{ env.DEPLOY_PATH }}
41- run : docker build -t "$IMAGE_NAME:latest" .
33+ run : docker build --pull - t "$IMAGE_NAME:latest" .
4234
4335 - name : Restart container
4436 run : |
Original file line number Diff line number Diff line change 1- FROM nginx:alpine
1+ FROM oven/bun:1 AS build
2+ WORKDIR /app
3+ COPY package.json bun.lock ./
4+ RUN bun install --frozen-lockfile
5+ COPY . .
6+ RUN bun run build
27
8+ FROM nginx:alpine
39RUN apk --no-cache upgrade \
4- && rm -rf /usr/share/nginx/html/*
10+ && rm -rf /usr/share/nginx/html/*
511
6- COPY . /usr/share/nginx/html/
12+ COPY --from=build /app/dist /usr/share/nginx/html/
713
814EXPOSE 80
You can’t perform that action at this time.
0 commit comments