feat: initial homepage with k8s auto-deploy
Build & Deploy Homepage / build-and-deploy (push) Successful in 9s
Build & Deploy Homepage / build-and-deploy (push) Successful in 9s
- 반응형 랜딩 페이지 (hero, features, how-it-works, solutions, AI agent, use cases, architecture, testimonials, FAQ, CTA) - 모든 체험/로그인 CTA는 https://solution.invyone.com/login 으로 연결 - Dockerfile + nginx 설정으로 정적 파일 서빙 - k8s manifests (namespace/deployment/service NodePort 30082) - Gitea Actions 자동 배포 워크플로우
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
name: Build & Deploy Homepage
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
env:
|
||||
REGISTRY: localhost:5000
|
||||
IMAGE: invyone/homepage
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set commit SHA
|
||||
run: echo "SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.SHORT_SHA }} .
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.SHORT_SHA }}
|
||||
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.SHORT_SHA }} ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
||||
|
||||
- name: Deploy to Kubernetes
|
||||
run: |
|
||||
export KUBECONFIG=/home/chpark/.kube/config
|
||||
|
||||
kubectl apply -f k8s/namespace.yaml
|
||||
kubectl apply -f k8s/deployment.yaml
|
||||
kubectl apply -f k8s/service.yaml
|
||||
|
||||
kubectl set image deployment/homepage \
|
||||
homepage=${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.SHORT_SHA }} \
|
||||
-n invyone-homepage
|
||||
|
||||
kubectl rollout status deployment/homepage -n invyone-homepage --timeout=120s
|
||||
@@ -0,0 +1,5 @@
|
||||
.DS_Store
|
||||
*.log
|
||||
node_modules/
|
||||
.vscode/
|
||||
.idea/
|
||||
@@ -0,0 +1,9 @@
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY homepage.html /usr/share/nginx/html/index.html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget -qO- http://localhost/ >/dev/null || exit 1
|
||||
@@ -0,0 +1,32 @@
|
||||
# invyone homepage
|
||||
|
||||
AI 에이전트 기반 노코드 엔터프라이즈 플랫폼 invyone의 랜딩 페이지.
|
||||
|
||||
- 운영 도메인: https://www.invyone.com
|
||||
- 솔루션(앱) 링크: https://solution.invyone.com/login
|
||||
|
||||
## 배포
|
||||
|
||||
`main` 브랜치에 push하면 Gitea Actions가 자동으로:
|
||||
|
||||
1. Docker 이미지 빌드 (`localhost:5000/invyone/homepage:<sha>`)
|
||||
2. 로컬 레지스트리에 push
|
||||
3. K8s `invyone-homepage` 네임스페이스로 rolling update
|
||||
|
||||
## 로컬 미리보기
|
||||
|
||||
```bash
|
||||
docker build -t invyone-homepage .
|
||||
docker run --rm -p 8080:80 invyone-homepage
|
||||
# → http://localhost:8080
|
||||
```
|
||||
|
||||
## 구조
|
||||
|
||||
```
|
||||
├── homepage.html # 정적 랜딩 페이지
|
||||
├── nginx.conf # nginx 설정
|
||||
├── Dockerfile # nginx:alpine 기반 이미지
|
||||
├── k8s/ # Kubernetes manifests
|
||||
└── .gitea/workflows/ # Gitea Actions CI/CD
|
||||
```
|
||||
+1711
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,48 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: homepage
|
||||
namespace: invyone-homepage
|
||||
labels:
|
||||
app: homepage
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 0
|
||||
selector:
|
||||
matchLabels:
|
||||
app: homepage
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: homepage
|
||||
spec:
|
||||
containers:
|
||||
- name: homepage
|
||||
image: localhost:5000/invyone/homepage:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
resources:
|
||||
requests:
|
||||
cpu: 20m
|
||||
memory: 32Mi
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 128Mi
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 80
|
||||
initialDelaySeconds: 2
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 80
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 15
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: invyone-homepage
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: homepage
|
||||
namespace: invyone-homepage
|
||||
labels:
|
||||
app: homepage
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: homepage
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 80
|
||||
nodePort: 30082
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
||||
gzip_min_length 1024;
|
||||
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location = /healthz {
|
||||
access_log off;
|
||||
return 200 "ok\n";
|
||||
}
|
||||
|
||||
location ~* \.(?:css|js|svg|png|jpg|jpeg|gif|ico|woff2?)$ {
|
||||
expires 7d;
|
||||
add_header Cache-Control "public, max-age=604800";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user