Files
slamduck-config/.gitea/workflows/build.yaml
T
lbj 93c46d65ef
build-and-push / build (push) Failing after 1m2s
push via harbor-core
2026-11-02 15:54:06 +08:00

30 lines
923 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: build-and-push
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 拉取代码
uses: https://gitea.com/actions/checkout@v4
- name: 验钞(临时)
env:
HARBOR_PASS: ${{ secrets.HARBOR_PASS }}
run: |
echo "Secret 里的密码长度: ${#HARBOR_PASS} (正确应为 10)"
- name: 登录 Harbor
env:
HARBOR_USER: ${{ secrets.HARBOR_USER }}
HARBOR_PASS: ${{ secrets.HARBOR_PASS }}
run: |
echo "$HARBOR_PASS" | docker login \
harbor-core.harbor.svc.cluster.local:5000 \
-u "$HARBOR_USER" --password-stdin
- name: 构建并推送镜像
run: |
docker build -t harbor-core.harbor.svc.cluster.local:5000/slamduck/demo-app:v1 ./demo-app
docker push harbor-core.harbor.svc.cluster.local:5000/slamduck/demo-app:v1