File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Build & push to Docker Hub
1+ name : Release
22
33on :
44 push :
@@ -11,15 +11,15 @@ permissions:
1111 id-token : write
1212
1313concurrency :
14- group : ' build '
14+ group : ' release '
1515 cancel-in-progress : true
1616
1717env :
1818 BUILD_PATH : ' .'
1919
2020jobs :
2121 build :
22- name : Build the image
22+ name : Release Docker image
2323 runs-on : ubuntu-latest
2424 steps :
2525 - uses : actions/checkout@v5
4848 build-args : |
4949 GIT_COMMIT=${{ steps.git_sha.outputs.full }}
5050 GIT_COMMIT_SHORT=${{ steps.git_sha.outputs.short }}
51+
52+ post :
53+ name : Remote deployment
54+ runs-on : ubuntu-latest
55+ needs : [build]
56+ steps :
57+ - uses : KessokuTeaTime/action-kessoku-private-ci@main
58+ with :
59+ auth : ${{ secrets.KTT_API_TOKEN }}
60+ endpoint : ${{ vars.KTT_API_ENDPOINT }}
61+ payload : |
62+ {
63+ "service_label": "${{ vars.SERVICE_LABEL }}"
64+ }
Original file line number Diff line number Diff line change 1- FROM node:lts AS build
1+ FROM node:lts AS builder
22
33ARG GIT_COMMIT
44ARG GIT_COMMIT_SHORT
@@ -8,13 +8,38 @@ ENV GIT_COMMIT_SHORT=$GIT_COMMIT_SHORT
88
99ENV PNPM_HOME="/pnpm"
1010ENV PATH="$PNPM_HOME:$PATH"
11+
1112RUN corepack enable
1213
1314WORKDIR /app
14- COPY package*.json ./
15- RUN pnpm install
15+
16+ # install deps (better cache)
17+ COPY pnpm-lock.yaml package.json ./
18+ RUN pnpm install --frozen-lockfile
19+
20+ # build
1621COPY . .
1722RUN pnpm run build
1823
19- FROM nginx:alpine AS runtime
20- COPY --from=build /app/dist /var/html
24+
25+ # runtime
26+ FROM node:lts-alpine AS runner
27+
28+ ENV PNPM_HOME="/pnpm"
29+ ENV PATH="$PNPM_HOME:$PATH"
30+
31+ RUN corepack enable
32+
33+ WORKDIR /app
34+
35+ # only runtime essentials
36+ COPY --from=builder /app/dist ./dist
37+ COPY package.json pnpm-lock.yaml ./
38+
39+ RUN pnpm install --prod
40+
41+ ENV PORT=3000
42+
43+ EXPOSE 3000
44+
45+ CMD ["pnpm" , "run" , "serve" ]
Original file line number Diff line number Diff line change @@ -27,5 +27,6 @@ export default defineConfig({
2727 } ,
2828 devToolbar : {
2929 enabled : false
30- }
30+ } ,
31+ output : 'static'
3132} )
Original file line number Diff line number Diff line change 66 "dev" : " astro dev" ,
77 "build" : " astro build" ,
88 "preview" : " astro preview" ,
9+ "serve" : " serve dist -l $PORT -s" ,
910 "astro" : " astro" ,
1011 "lint" : " eslint ." ,
1112 "lint:fix" : " eslint . --fix" ,
4445 "prettier" : " ^3.6.2" ,
4546 "prettier-plugin-astro" : " ^0.14.1" ,
4647 "sass-embedded" : " ^1.93.3" ,
48+ "serve" : " ^14.2.5" ,
4749 "typescript" : " ^5.9.3" ,
4850 "typescript-eslint" : " ^8.47.0"
4951 }
You can’t perform that action at this time.
0 commit comments