This repository was archived by the owner on Dec 22, 2025. It is now read-only.
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 : Deploy website
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ deploy-website :
8+ runs-on : ubuntu-latest
9+
10+ steps :
11+ - name : Checkout Repository
12+ uses : actions/checkout@v4
13+
14+ - name : Build Docker image
15+ run : docker build -t oliverschlueter/fancywebsite:latest .
16+
17+
18+ - name : Log in to Docker Hub
19+ uses : docker/login-action@v2
20+ with :
21+ username : ${{ secrets.DOCKER_USERNAME }}
22+ password : ${{ secrets.DOCKER_PASSWORD }}
23+
24+ - name : Push Docker image
25+ run : docker push oliverschlueter/fancywebsite:latest
Original file line number Diff line number Diff line change 1+ # ===== Stage 1: Build =====
2+ FROM node:18-alpine AS builder
3+
4+ WORKDIR /app
5+
6+ # Install dependencies first for caching
7+ COPY package.json package-lock.json ./
8+ RUN npm ci
9+
10+ # Copy the rest of the project and build
11+ COPY . .
12+ RUN npm run build
13+
14+ # ===== Stage 2: Serve with Nginx =====
15+ FROM nginx:stable-alpine
16+
17+ # Remove default Nginx files
18+ RUN rm -rf /usr/share/nginx/html/*
19+
20+ # Copy built files from builder
21+ COPY --from=builder /app/dist /usr/share/nginx/html
22+
23+ # Copy custom nginx config (optional)
24+ # COPY nginx.conf /etc/nginx/conf.d/default.conf
25+
26+ EXPOSE 80
27+ CMD ["nginx" , "-g" , "daemon off;" ]
You can’t perform that action at this time.
0 commit comments