更新 .gitea/workflows/push.yml
Some checks failed
Docker Build & Deploy / Build Docker Image (push) Failing after 1m4s
Docker Build & Deploy / Deploy to Production (push) Has been skipped

This commit is contained in:
2025-03-05 18:47:30 +08:00
parent 5a09c6ec23
commit 7d3dab9971

View File

@@ -10,10 +10,10 @@ env: # 全局环境变量
jobs: jobs:
build: build:
name: Build Docker Image name: Build Docker Image
runs-on: self-hosted # 必须与 runner 的标签匹配 (如 GITEA_RUNNER_LABELS: "docker") runs-on: ubuntu-latest # 必须与 runner 的标签匹配 (如 GITEA_RUNNER_LABELS: "docker")
steps: steps:
- name: Checkout code # ✅ 必须添加代码检出 - name: Checkout code # ✅ 必须添加代码检出
uses: actions/checkout@v3 uses: addnab/docker-run-action@v3
- name: Cleanup old containers - name: Cleanup old containers
run: | run: |
@@ -25,7 +25,7 @@ jobs:
deploy: deploy:
name: Deploy to Production name: Deploy to Production
runs-on: self-hosted runs-on: ubuntu-22.04
needs: build # ⚠️ 确保在 build 任务完成后执行 needs: build # ⚠️ 确保在 build 任务完成后执行
environment: production # 需要先在 Gitea 仓库设置中创建环境 environment: production # 需要先在 Gitea 仓库设置中创建环境
steps: steps:
@@ -33,5 +33,4 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Start containers - name: Start containers
run: run: docker compose -p $COMPOSE_PROJECT_NAME up -d
docker compose -p $COMPOSE_PROJECT_NAME up -d