Docker build workflow
Some checks failed
Build and Deploy / build-deploy (push) Failing after 6s
Test Runner / test (push) Successful in 3s

This commit is contained in:
2025-11-19 15:28:31 +08:00
parent 435b03e3e9
commit 882b2e0317

View File

@@ -1,4 +1,4 @@
name: Deploy to K3S name: Build and Deploy
on: on:
push: push:
@@ -6,24 +6,30 @@ on:
- main - main
jobs: jobs:
deploy: build-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install Helm - name: Build Docker Images
run: | run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash # 後端
helm version docker build -t cloudforge-dashboard-backend:${{ github.sha }} ./dashboard-backend
docker tag cloudforge-dashboard-backend:${{ github.sha }} cloudforge-dashboard-backend:latest
# 前端
docker build -t cloudforge-dashboard-frontend:${{ github.sha }} ./dashboard-frontend
docker tag cloudforge-dashboard-frontend:${{ github.sha }} cloudforge-dashboard-frontend:latest
echo "✅ Images built successfully"
- name: Deploy with Helm - name: Check images
run: | run: docker images | grep cloudforge
helm upgrade --install cloudforge ./cloudforge-dashboard-helm \
-n cloudforge \
--create-namespace
- name: Verify Deployment - name: Deploy to K3S
run: | run: |
kubectl rollout status deployment/dashboard-backend -n cloudforge -t 300s echo "✅ Ready to deploy"
# 暫時先驗證 build 成功
# 下一步:設置 kubeconfig 和部署