feat: 添加生产环境部署工作流
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
name: Deploy Production
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
|
||||||
|
env:
|
||||||
|
COMPOSE_PROJECT_NAME: zhixing-system
|
||||||
|
ZHIXING_WEB_PORT: "8111"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Validate production compose
|
||||||
|
run: docker compose -f docker-compose.prod.yml config
|
||||||
|
|
||||||
|
- name: Build and deploy services
|
||||||
|
run: docker compose -f docker-compose.prod.yml up -d --build --remove-orphans
|
||||||
|
|
||||||
|
- name: Verify web service
|
||||||
|
run: docker compose -f docker-compose.prod.yml exec -T web wget -q -O - http://127.0.0.1/healthz
|
||||||
|
|
||||||
|
- name: Show deployed services
|
||||||
|
if: always()
|
||||||
|
run: docker compose -f docker-compose.prod.yml ps
|
||||||
Reference in New Issue
Block a user