From fdf80d81d7db6c8d28f4dec004dcd0f4a4a212f7 Mon Sep 17 00:00:00 2001 From: ChenKaiLiuG Date: Sat, 3 Jan 2026 15:01:59 +0000 Subject: [PATCH] Update .gitea/workflows/build.yaml Signed-off-by: ChenKaiLiuG --- .drone.yml | 36 ------------------------------------ .gitea/workflows/build.yaml | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 36 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/build.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 54c0ce24..00000000 --- a/.drone.yml +++ /dev/null @@ -1,36 +0,0 @@ -kind: pipeline -type: docker -name: build-goedge - -trigger: - branch: - - master - event: - - push - - tag - -steps: - # 第一步:編譯 EdgeAdmin - - name: build-admin - image: docker:dind - volumes: - - name: docker - path: /var/run/docker.sock - commands: - - docker build -f docker/Dockerfile -t localhost:5700/goedge-admin:${DRONE_COMMIT_SHA:0:7} . - - docker tag localhost:5700/goedge-admin:${DRONE_COMMIT_SHA:0:7} localhost:5700/goedge-admin:latest - - # 第二步:推送到你的 Registry - - name: push-admin - image: docker:dind - volumes: - - name: docker - path: /var/run/docker.sock - commands: - - docker push localhost:5700/goedge-admin:${DRONE_COMMIT_SHA:0:7} - - docker push localhost:5700/goedge-admin:latest - -volumes: - - name: docker - host: - path: /var/run/docker.sock \ No newline at end of file diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 00000000..61245303 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,22 @@ +name: Build and Push Docker Image +on: [push] # 只要有代碼更新或上傳檔案,自動觸發 + +jobs: + build: + runs-on: ubuntu-latest # 對應你的 Runner + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Build and Push + run: | + # 登入內建 Registry (變數會自動填入) + docker login gitea-server:3000 -u ${{ gitea.actor }} -p ${{ secrets.GITHUB_TOKEN }} + + # 編譯 (映像檔名稱: gitea-server:3000/使用者/倉庫名:latest) + IMAGE_NAME="gitea-server:3000/${{ gitea.repository }}:latest" + docker build -t $IMAGE_NAME . + docker push $IMAGE_NAME + + echo "編譯完成!" + echo "外部 Portainer 拉取網址: 192.168.10.100:3000/${{ gitea.repository }}:latest" \ No newline at end of file