ci: update harbor
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m55s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m55s
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user