This commit is contained in:
@ -3,28 +3,12 @@ run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
# 一个直接在宿主机上执行的 Job
|
||||||
runs-on: ubuntu-latest
|
host-commands:
|
||||||
container:
|
runs-on: self-hosted # 需要有一个标签为 self-hosted 的 runner 运行在宿主机上
|
||||||
image: gitea/runner-images:ubuntu-latest
|
|
||||||
steps:
|
steps:
|
||||||
- name: clone project code
|
- name: 在宿主机上执行命令
|
||||||
run: git clone ${{ gitea.server_url }}/${{ gitea.repository }} .
|
|
||||||
- name: List files
|
|
||||||
run: ls -la
|
|
||||||
- name: Stop running containers
|
|
||||||
run: |
|
run: |
|
||||||
docker compose down || true
|
echo "This command runs directly on the host machine"
|
||||||
- name: Remove old image
|
# 例如:检查宿主机内核版本
|
||||||
run: |
|
uname -a
|
||||||
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
|
|
||||||
2
models/__init__.py
Normal file
2
models/__init__.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
from models.source_content import SourceContent
|
||||||
|
from models.article import Article
|
||||||
Reference in New Issue
Block a user