Merge pull request #93 from svc-design/codex/combine-jobs-1-and-jobs-2-into-pipeline
feat: add unified deployment pipeline
This commit is contained in:
commit
d79a558b07
41
.github/workflows/deploy-all.yml
vendored
Normal file
41
.github/workflows/deploy-all.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
name: Unified Deploy Pipeline
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy-homepage:
|
||||
uses: ./.github/workflows/deploy-homepage.yml
|
||||
secrets: inherit
|
||||
|
||||
deploy-xcontrol-panel:
|
||||
uses: ./.github/workflows/deploy-xcontrol-panel.yml
|
||||
secrets: inherit
|
||||
|
||||
deploy-xcontrol-server:
|
||||
uses: ./.github/workflows/deploy-xcontrol-server.yml
|
||||
secrets: inherit
|
||||
|
||||
deploy-proxy-nginx:
|
||||
needs:
|
||||
- deploy-homepage
|
||||
- deploy-xcontrol-panel
|
||||
- deploy-xcontrol-server
|
||||
uses: ./.github/workflows/deploy-proxy-nginx.yml
|
||||
secrets: inherit
|
||||
|
||||
setup-proxy-cn-homepage:
|
||||
needs:
|
||||
- deploy-homepage
|
||||
- deploy-xcontrol-panel
|
||||
- deploy-xcontrol-server
|
||||
uses: ./.github/workflows/setup-proxy-cn-homepage.yml
|
||||
secrets: inherit
|
||||
|
||||
setup-proxy-global-homepage:
|
||||
needs:
|
||||
- deploy-homepage
|
||||
- deploy-xcontrol-panel
|
||||
- deploy-xcontrol-server
|
||||
uses: ./.github/workflows/setup-proxy-global-homepage.yml
|
||||
secrets: inherit
|
||||
1
.github/workflows/deploy-homepage.yml
vendored
1
.github/workflows/deploy-homepage.yml
vendored
@ -10,6 +10,7 @@ on:
|
||||
- 'ui/homepage/**'
|
||||
- '.github/workflows/deploy-homepage.yml'
|
||||
branches: [main]
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
1
.github/workflows/deploy-proxy-nginx.yml
vendored
1
.github/workflows/deploy-proxy-nginx.yml
vendored
@ -2,6 +2,7 @@ name: Configure Proxy Nginx
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
setup-nginx:
|
||||
|
||||
1
.github/workflows/deploy-xcontrol-panel.yml
vendored
1
.github/workflows/deploy-xcontrol-panel.yml
vendored
@ -10,6 +10,7 @@ on:
|
||||
- 'ui/panel/**'
|
||||
- '.github/workflows/deploy-xcontrol-panel.yml'
|
||||
branches: [main]
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
24
.github/workflows/deploy-xcontrol-server.yml
vendored
Normal file
24
.github/workflows/deploy-xcontrol-server.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
name: Deploy Xcontrol Server
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 📦 Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🧰 Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
- name: 🏗️ Build server
|
||||
run: go build ./cmd/api
|
||||
|
||||
- name: 🚀 Deploy server
|
||||
run: |
|
||||
echo "Deploying server..."
|
||||
@ -6,6 +6,7 @@ on:
|
||||
dummy:
|
||||
description: 'Manual trigger'
|
||||
required: false
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
46
.github/workflows/setup-proxy-global-homepage.yml
vendored
Normal file
46
.github/workflows/setup-proxy-global-homepage.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
name: Setup Proxy for global-homepage.svc.plus
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Configure Nginx on proxy host
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
with:
|
||||
host: ${{ secrets.GLOBAL_PROXY_HOST }}
|
||||
username: ${{ secrets.GLOBAL_PROXY_HOST_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
script: |
|
||||
apt-get update
|
||||
apt-get install -y nginx
|
||||
cat <<'NGINXCONF' > /etc/nginx/sites-available/default
|
||||
# 1. HTTP 自动跳转到 HTTPS
|
||||
server {
|
||||
listen 80;
|
||||
server_name global-homepage.svc.plus;
|
||||
return 301 https://global-homepage.svc.plus$request_uri;
|
||||
}
|
||||
|
||||
# 2. HTTPS 静态站部署
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name global-homepage.svc.plus;
|
||||
|
||||
ssl_certificate /etc/ssl/svc.plus.pem;
|
||||
ssl_certificate_key /etc/ssl/svc.plus.rsa.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
root /var/www/XControl/ui/homepage/out;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
NGINXCONF
|
||||
systemctl restart nginx
|
||||
Loading…
Reference in New Issue
Block a user