From 0f97d71a6bb4fade5d91fecd680e7751c75ca695 Mon Sep 17 00:00:00 2001 From: konjacpotato Date: Sun, 15 Feb 2026 19:16:42 +0800 Subject: [PATCH] change gitea action --- .gitea/workflows/deploy-workflow.yml | 30 +++++++--------------------- models/__init__.py | 2 ++ 2 files changed, 9 insertions(+), 23 deletions(-) create mode 100644 models/__init__.py diff --git a/.gitea/workflows/deploy-workflow.yml b/.gitea/workflows/deploy-workflow.yml index d4730b4..7a44cc7 100644 --- a/.gitea/workflows/deploy-workflow.yml +++ b/.gitea/workflows/deploy-workflow.yml @@ -3,28 +3,12 @@ run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 on: [push] jobs: - deploy: - runs-on: ubuntu-latest - container: - image: gitea/runner-images:ubuntu-latest + # 一个直接在宿主机上执行的 Job + host-commands: + runs-on: self-hosted # 需要有一个标签为 self-hosted 的 runner 运行在宿主机上 steps: - - name: clone project code - run: git clone ${{ gitea.server_url }}/${{ gitea.repository }} . - - name: List files - run: ls -la - - name: Stop running containers + - name: 在宿主机上执行命令 run: | - docker compose down || true - - name: Remove old image - run: | - IMAGE_NAME=$(basename "$PWD") - echo "Removing old image: $IMAGE_NAME" - docker images | grep "$IMAGE_NAME" && docker rmi -f $(docker images "$IMAGE_NAME" -q) || echo "No old image found." - - name: Build new image - run: | - docker build -t $(basename "$PWD"):latest . - - name: Start containers - run: | - docker compose up -d - - name: Show container status - run: docker ps \ No newline at end of file + echo "This command runs directly on the host machine" + # 例如:检查宿主机内核版本 + uname -a \ No newline at end of file diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..c998ac6 --- /dev/null +++ b/models/__init__.py @@ -0,0 +1,2 @@ +from models.source_content import SourceContent +from models.article import Article \ No newline at end of file