Files
watch-stock-list/.gitea/workflows/docker-build.yml
niyyzf 1b41d10574
Some checks failed
构建并运行 Docker / build (push) Failing after 12m9s
优化 Docker 构建流程,移除构建缓存选项
2025-07-31 18:33:46 +08:00

31 lines
808 B
YAML
Raw Permalink 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: 构建并运行 Docker
on:
push:
tags:
- 'v*' # 只在以 build-v 开头的 tag如 build-v1.0.0)时触发
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 释放内存
run: docker system prune -a -f
- name: 拉取自定义 checkout action
run: git clone http://114.67.155.184:3000//niyyzf/checkout.git ./.actions/checkout
- name: 检出代码
uses: ./.actions/checkout
with:
fetch-depth: 1
persist-credentials: false
max-attempts: 5
- name: 构建 Docker 镜像
run: docker build -t watch-stock-list:latest .
- name: 启动/重启服务Docker Compose
run: |
docker compose down || true
docker compose up -d --force-recreate