change deploy.yaml

This commit is contained in:
2026-03-18 02:28:06 +08:00
parent 1cc4f79e50
commit 508ed8c2ec

View File

@@ -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