Files
slamduck-config/.gitea/workflows/build.yaml
T
Workflow config file is invalid. Please check your config file: model.ReadWorkflow: yaml: line 15: mapping values are not allowed in this context
2026-11-02 15:15:19 +08:00

26 lines
840 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
run: |
echo "${{ secrets.HARBOR_PASS }}" | docker login \
harbor-registry.harbor.svc.cluster.local:5000 \
-u "${{ secrets.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