modify gitea action
Some checks failed
Gitea Actions Demo / host-commands (push) Failing after 0s

This commit is contained in:
konjacpotato
2026-02-15 19:51:31 +08:00
parent b453e8ccbc
commit 4471bbfdc8

View File

@ -5,10 +5,16 @@ on: [push]
jobs: jobs:
# 一个直接在宿主机上执行的 Job # 一个直接在宿主机上执行的 Job
host-commands: host-commands:
runs-on: mac # 需要有一个标签为 self-hosted 的 runner 运行在宿主机上 runs-on: mac # 需要有一个标签为 mac 的 runner 运行在宿主机上
steps: steps:
- name: 在宿主机上执行命令 - name: 在宿主机上执行命令
run: | run: |
echo "This command runs directly on the host machine" echo "This command runs directly on the host machine"
# 例如:检查宿主机内核版本 # 进入项目目录
uname -a cd /Users/konjacpotato/workspace/code/peter
# 结束旧的 screen 会话 screen -X -S peter quit || true
screen -ls | awk '/\.peter\t/ {print $1}' | xargs -I{} screen -X -S {} quit
# 启动新的 screen 会话并在其中运行命令
screen -dmS peter bash -c "source ~/.zshrc ; conda activate peter ; python peter.py"
# 确认会话已启动
screen -list | grep peter