From 6ee64b1ba32fb97e5ce47acd0d8ff7f43d0ff9a6 Mon Sep 17 00:00:00 2001 From: zfxt Date: Wed, 3 Sep 2025 22:58:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=8F=E4=BE=BF=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-test.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .gitea/workflows/docker-test.yml diff --git a/.gitea/workflows/docker-test.yml b/.gitea/workflows/docker-test.yml new file mode 100644 index 0000000..7fea5ff --- /dev/null +++ b/.gitea/workflows/docker-test.yml @@ -0,0 +1,29 @@ +name: Build and Push Docker Image + +on: [push] # 在每次 push 时触发 + +jobs: + build-and-push: + runs-on: ubuntu-latest # 使用 Ubuntu 环境运行 + steps: + # 步骤1: 检出仓库代码 + - name: Checkout code + uses: actions/checkout@v4 # 使用 Gitea 官方的 checkout action + + # 步骤2: 登录到 Docker Registry (你的 Gitea 仓库) + - name: Log in to Docker Registry + uses: docker/login-action@v2 + with: + registry: gitea.zfxt.top + username: ${{ secrets.REGISTRY_USERNAME }} # 将用户名存储在仓库的 Secrets 中 + password: ${{ secrets.REGISTRY_PASSWORD }} # 将密码或个人访问令牌存储在 Secrets 中 + + # 步骤3: 构建 Docker 镜像 + - name: Build Docker image + run: | + cd ./backend + docker build -t gitea.zfxt.top/zfxt/haha:latest . + docker push gitea.zfxt.top/zfxt/haha:latest + + +