Update .gitea/workflows/build.yaml
Signed-off-by: ChenKaiLiuG <ckliu119@gmail.com>
This commit is contained in:
22
.gitea/workflows/build.yaml
Normal file
22
.gitea/workflows/build.yaml
Normal 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"
|
||||
Reference in New Issue
Block a user