Update .gitea/workflows/build.yaml

Signed-off-by: ChenKaiLiuG <ckliu119@gmail.com>
This commit is contained in:
2026-01-03 15:01:59 +00:00
parent 3a539e8870
commit fdf80d81d7
2 changed files with 22 additions and 36 deletions

View File

@@ -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

View File

@@ -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"