ci: add auto-deploy step
All checks were successful
build-deploy / build-deploy (push) Successful in 18s
All checks were successful
build-deploy / build-deploy (push) Successful in 18s
This commit is contained in:
parent
0571589904
commit
ed718eb48f
@ -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-portal
|
- name: Build & push muyu-portal
|
||||||
@ -23,3 +23,13 @@ jobs:
|
|||||||
docker push "$REG/muyu-portal:latest"
|
docker push "$REG/muyu-portal:latest"
|
||||||
rm -rf "$workdir"
|
rm -rf "$workdir"
|
||||||
echo "done: muyu-portal pushed at $TAG + latest"
|
echo "done: muyu-portal pushed at $TAG + latest"
|
||||||
|
|
||||||
|
- name: Deploy to dev-chiba
|
||||||
|
run: |
|
||||||
|
set -eo pipefail
|
||||||
|
app="$HOME/apps/muyu"
|
||||||
|
[ -d "$app" ] || { echo "!! $app 未部署,跳过"; exit 0; }
|
||||||
|
cd "$app"
|
||||||
|
docker compose pull portal
|
||||||
|
docker compose up -d portal
|
||||||
|
echo "deployed: portal"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user