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:16:51 +08:00

26 lines
819 B
YAML

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}"
- 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