Files
linebot_finance/.gitea/workflows/deploy.yaml
2026-03-18 01:57:03 +08:00

28 lines
788 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Oracle-Deploy
on:
push:
branches:
- main
jobs:
redeploy:
# 這裡請確認你的 Runner 標籤,如果當初填的是 host就改填 host
runs-on: self-hosted
# 加上這個,強迫 Runner 直接在 Ubuntu 系統環境跑,不准開 Docker 容器跑任務
container:
image: ""
steps:
- name: Sync and Deploy
run: |
cd /home/ubuntu/apps/linebot_finance || exit 1
git fetch origin main
git reset --hard origin/main
# 先找一下 docker 在哪,避免它路徑又跑掉
DOCKER_PATH=$(which docker)
echo "Using docker at: $DOCKER_PATH"
$DOCKER_PATH compose up -d --build --remove-orphans
$DOCKER_PATH image prune -f