Files
slamduck-config/.gitea/workflows/build.yaml
T
lbj f0ad77e7d4
build-and-push / build (push) Failing after 3s
fix workflow yaml
2026-11-02 15:41:12 +08:00

30 lines
935 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} (正确应为 11)"
- name: 登录 Harbor
env:
HARBOR_USER: ${{ secrets.HARBOR_USER }}
HARBOR_PASS: ${{ secrets.HARBOR_PASS }}
run: |
echo "$HARBOR_PASS" | docker login \
harbor-registry.harbor.svc.cluster.local:5000 \
-u "$HARBOR_USER" --password-stdin
- name: 构建并推送镜像
run: |
docker build -t harbor-registry.harbor.svc.cluster.local:5000/slamduck/demo-app:v1 ./demo-app
docker push harbor-registry.harbor.svc.cluster.local:5000/slamduck/demo-app:v1