add CI workflow + demo-app
build-and-push / build (push) Failing after 48s

This commit is contained in:
lbj
2026-11-02 14:39:17 +08:00
parent 27e36ef6e3
commit 944b258b79
3 changed files with 24 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
name: build-and-push
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 拉取代码
uses: https://gitea.com/actions/checkout@v4
- name: 登录 Harbor
run: |
echo "${{ secrets.HARBOR_PASS }}" | docker login \
harbor-harbor-registry.harbor.svc.cluster.local:5000 \
-u "${{ secrets.HARBOR_USER }}" --password-stdin
- name: 构建并推送镜像
run: |
docker build -t harbor-harbor-registry.harbor.svc.cluster.local:5000/slamduck/demo-app:v1 ./demo-app
docker push harbor-harbor-registry.harbor.svc.cluster.local:5000/slamduck/demo-app:v1
+2
View File
@@ -0,0 +1,2 @@
FROM nginx:alpine
COPY index.html /usr/share/nginx/html/index.html
+1
View File
@@ -0,0 +1 @@
<h1>CI 构建的第一个应用20261102 v1</h1>