ci: update harbor
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m55s

This commit is contained in:
Zpekii
2026-01-25 16:06:56 +08:00
parent 4c3670a43c
commit d21cd672a6

View File

@@ -48,18 +48,18 @@ jobs:
docker --version
- name: Login to Harbor
run: |
echo "${{ secrets.HARBOR_PASSWORD }}" | docker login localhost:8180 -u "${{ secrets.HARBOR_USERNAME }}" --password-stdin
echo "${{ secrets.HARBOR_PASSWORD }}" | docker login harbor.0orz.top -u "${{ secrets.HARBOR_USERNAME }}" --password-stdin
- name: Build Docker image
run: |
cd ${{ gitea.workspace }}
docker build -t localhost:8180/go-example/go-example:${{ gitea.sha }} .
docker build -t harbor.0orz.top/go-example/go-example:${{ gitea.sha }} .
- name: Push Docker image to local registry
run: |
docker push localhost:8180/go-example/go-example:${{ gitea.sha }}
docker push harbor.0orz.top/go-example/go-example:${{ gitea.sha }}
- name: Update manifest and Push to Git
run: |
# 使用 kustomize 或 sed 修改镜像版本
sed -i "s|image: .*:.*|image: localhost:8180/go-example/go-example:${{ gitea.sha }}|g" deployment.yaml
sed -i "s|image: .*:.*|image: harbor.0orz.top/go-example/go-example:${{ gitea.sha }}|g" deployment.yaml
# 配置 Git 并提交回仓库
git config --global user.name "Gitea Action"