mirror of
https://github.com/henry4682/linebot_finance.git
synced 2026-05-16 04:41:52 +00:00
change deploy.yaml
This commit is contained in:
@@ -6,11 +6,8 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
redeploy:
|
redeploy:
|
||||||
runs-on: self-hosted # 這裡要跟剛才補上的標籤一致
|
# 這裡必須跟剛才在 config.yaml 填的一模一樣
|
||||||
|
runs-on: self-hosted
|
||||||
# 加上這個,強迫 Runner 直接在 Ubuntu 系統環境跑,不准開 Docker 容器跑任務
|
|
||||||
container:
|
|
||||||
image: ""
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Sync and Deploy
|
- name: Sync and Deploy
|
||||||
@@ -18,10 +15,6 @@ jobs:
|
|||||||
cd /home/ubuntu/apps/linebot_finance || exit 1
|
cd /home/ubuntu/apps/linebot_finance || exit 1
|
||||||
git fetch origin main
|
git fetch origin main
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
|
# 宿主機模式下,這裡就能直接用到 docker 了
|
||||||
# 先找一下 docker 在哪,避免它路徑又跑掉
|
docker compose up -d --build --remove-orphans
|
||||||
DOCKER_PATH=$(which docker)
|
docker image prune -f
|
||||||
echo "Using docker at: $DOCKER_PATH"
|
|
||||||
|
|
||||||
$DOCKER_PATH compose up -d --build --remove-orphans
|
|
||||||
$DOCKER_PATH image prune -f
|
|
||||||
Reference in New Issue
Block a user