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:
push:
@@ -6,24 +6,30 @@ on:
- main
jobs:
deploy:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout code
uses: actions/checkout@v3
- name: Install Helm
- name: Build Docker Images
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
run: |
helm upgrade --install cloudforge ./cloudforge-dashboard-helm \
-n cloudforge \
--create-namespace
- name: Check images
run: docker images | grep cloudforge
- name: Verify Deployment
- name: Deploy to K3S
run: |
kubectl rollout status deployment/dashboard-backend -n cloudforge -t 300s
echo "✅ Ready to deploy"
# 暫時先驗證 build 成功
# 下一步:設置 kubeconfig 和部署