File tree Expand file tree Collapse file tree 4 files changed +60
-0
lines changed
Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ name : FrontendDeploy
2+ on :
3+ push :
4+ branches :
5+ - master
6+
7+ jobs :
8+ Deploy :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Login to Docker Hub
12+ uses : docker/login-action@v3
13+ with :
14+ username : ${{ vars.DOCKERHUB_USERNAME }}
15+ password : ${{ secrets.DOCKERHUB_TOKEN }}
16+ - uses : actions/checkout@v3
17+ - name : Build and push
18+ uses : docker/build-push-action@v6
19+ with :
20+ push : true
21+ tags : docker.io/eewynell/coduels-frontend:latest
Original file line number Diff line number Diff line change 1+ FROM node:24-slim AS builder
2+
3+ RUN npm i -g pnpm
4+
5+ WORKDIR /app
6+
7+ COPY package.json pnpm-lock.yaml ./
8+
9+ RUN pnpm i
10+
11+ COPY src src
12+ COPY public public
13+ COPY *.ts *.js *.json *.yaml *.yml *.html ./
14+
15+ ARG VITE_BASE_URL=/api
16+ ENV VITE_BASE_URL=${VITE_BASE_URL}
17+
18+ RUN pnpm build
19+
20+ FROM nginx:alpine-slim
21+
22+ COPY ./nginx.conf /etc/nginx/nginx.conf
23+
24+ COPY --from=builder /app/dist/ /var/www
25+
Original file line number Diff line number Diff line change 1+ http {
2+ server {
3+ include mime.types ;
4+ listen 8080 ;
5+ root /var/www;
6+ try_files $uri $uri / /index .html;
7+ }
8+ }
9+
10+ events {}
11+
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ import svgr from "vite-plugin-svgr";
44
55// https://vite.dev/config/
66export default defineConfig ( {
7+ build : {
8+ sourcemap : true ,
9+ } ,
710 plugins : [ react ( ) , svgr ( ) ] ,
811 server : {
912 host : "127.0.0.1" ,
You can’t perform that action at this time.
0 commit comments