File tree Expand file tree Collapse file tree 4 files changed +107
-0
lines changed Expand file tree Collapse file tree 4 files changed +107
-0
lines changed Original file line number Diff line number Diff line change 1+ node_modules
2+ .git
3+ .gitignore
4+ .vscode
5+ .DS_Store
6+ * .md
7+ ! README.md
8+ dist
9+ .astro
10+ .env
11+ .env.local
12+ .env.production
13+ npm-debug.log *
14+ yarn-debug.log *
15+ yarn-error.log *
Original file line number Diff line number Diff line change 1+ name : Build and Push to GHCR
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ env :
9+ REGISTRY : ghcr.io
10+ IMAGE_NAME : getlumos/docs-lumos
11+
12+ jobs :
13+ build-and-push :
14+ runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+ packages : write
18+
19+ steps :
20+ - name : Checkout repository
21+ uses : actions/checkout@v4
22+
23+ - name : Log in to GitHub Container Registry
24+ uses : docker/login-action@v3
25+ with :
26+ registry : ${{ env.REGISTRY }}
27+ username : ${{ github.actor }}
28+ password : ${{ secrets.GITHUB_TOKEN }}
29+
30+ - name : Extract metadata for Docker
31+ id : meta
32+ uses : docker/metadata-action@v5
33+ with :
34+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+ tags : |
36+ type=raw,value=latest
37+ type=sha,prefix=sha-
38+
39+ - name : Build and push Docker image
40+ uses : docker/build-push-action@v5
41+ with :
42+ context : .
43+ push : true
44+ tags : ${{ steps.meta.outputs.tags }}
45+ labels : ${{ steps.meta.outputs.labels }}
46+
47+ - name : Image published
48+ run : |
49+ echo "Image pushed to ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
50+ echo "Pull command: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
Original file line number Diff line number Diff line change 1+ # Stage 1: Build the Astro site
2+ FROM node:20-alpine AS builder
3+
4+ WORKDIR /app
5+
6+ # Copy package files
7+ COPY package*.json ./
8+
9+ # Install dependencies
10+ RUN npm ci
11+
12+ # Copy source files
13+ COPY . .
14+
15+ # Build the site
16+ RUN npm run build
17+
18+ # Stage 2: Serve with nginx
19+ FROM nginx:alpine
20+
21+ # Copy built files from builder stage
22+ COPY --from=builder /app/dist /usr/share/nginx/html
23+
24+ # Copy nginx configuration (if needed)
25+ # COPY nginx.conf /etc/nginx/nginx.conf
26+
27+ # Expose port 80
28+ EXPOSE 80
29+
30+ # Start nginx
31+ CMD ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+
3+ services :
4+ docs :
5+ image : ghcr.io/getlumos/docs-lumos:latest
6+ container_name : docs-lumos
7+ restart : unless-stopped
8+ ports :
9+ - " 3001:80"
10+ environment :
11+ - NODE_ENV=production
You can’t perform that action at this time.
0 commit comments