This commit is contained in:
@@ -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
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
FROM nginx:alpine
|
||||||
|
COPY index.html /usr/share/nginx/html/index.html
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<h1>CI 构建的第一个应用20261102 v1</h1>
|
||||||
Reference in New Issue
Block a user