ci: add auto-deploy step
All checks were successful
build-deploy / build-deploy (push) Successful in 1m59s
All checks were successful
build-deploy / build-deploy (push) Successful in 1m59s
This commit is contained in:
parent
3ad9859d00
commit
43f0be7f31
@ -1,11 +1,11 @@
|
|||||||
name: build
|
name: build-deploy
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Build & push muyu services
|
- name: Build & push muyu services
|
||||||
@ -40,3 +40,15 @@ jobs:
|
|||||||
|
|
||||||
rm -rf "$workdir"
|
rm -rf "$workdir"
|
||||||
echo "done: pushed 5 muyu images at tag $TAG + latest"
|
echo "done: pushed 5 muyu images at tag $TAG + latest"
|
||||||
|
|
||||||
|
- name: Deploy to dev-chiba
|
||||||
|
run: |
|
||||||
|
set -eo pipefail
|
||||||
|
app="$HOME/apps/muyu"
|
||||||
|
[ -d "$app" ] || { echo "!! $app 未部署,跳过(首次需手动 compose up)"; exit 0; }
|
||||||
|
cd "$app"
|
||||||
|
svcs="system-rpc inventory-rpc purchase-rpc production-rpc gateway"
|
||||||
|
docker compose pull $svcs
|
||||||
|
docker compose up -d $svcs
|
||||||
|
docker compose ps --format "table {{.Name}}\t{{.Status}}"
|
||||||
|
echo "deployed: $svcs"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user