From 34432e77c7e725858266db98ee4e29b250063501 Mon Sep 17 00:00:00 2001 From: sangge-redmi <2251250136@qq.com> Date: Tue, 14 Jan 2025 09:02:37 +0800 Subject: [PATCH] add base image ci --- .gitea/workflows/build_image.yaml | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitea/workflows/build_image.yaml diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml new file mode 100644 index 0000000..06c0f53 --- /dev/null +++ b/.gitea/workflows/build_image.yaml @@ -0,0 +1,39 @@ +name: Build and Push Base Image + +on: + push: + paths: + - "basedockerfile" + schedule: + - cron: "0 0 1 * *" # 每月1号00:00执行 + workflow_dispatch: # 允许手动触发 + +env: + REGISTRY: git.mamahaha.work + IMAGE_NAME: tpre + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: https://git.mamahaha.work/actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Private Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: basedockerfile + push: true + tags: | + ${{ env.REGISTRY }}/sangge/${{ env.IMAGE_NAME }}:base