Compare commits

...

16 Commits

Author SHA1 Message Date
小贺
bc721287df 变更变量存储位置
All checks were successful
Build and Push Docker Images / build-and-push (backend) (push) Successful in 1m21s
Build and Push Docker Images / build-and-push (frontend) (push) Successful in 17s
2025-09-04 15:47:10 +08:00
小贺
f609e1725f 精简镜像 2025-09-04 15:47:10 +08:00
1bb91aab66 更新 README.md
Some checks failed
Build and Push Docker Images / build-and-push (backend) (push) Failing after 12s
Build and Push Docker Images / build-and-push (frontend) (push) Failing after 12s
2025-09-04 13:03:24 +08:00
a87161081b 添加执行操作
Some checks failed
Build and Push Docker Images / build-and-push (backend) (push) Has started running
Build and Push Docker Images / build-and-push (frontend) (push) Has been cancelled
2025-09-04 13:03:01 +08:00
zfxt-ubuntu
c3648d1102 修改镜像名可以直接运行
All checks were successful
Build and Push Docker Images / build-and-push (backend) (push) Successful in 17s
Build and Push Docker Images / build-and-push (frontend) (push) Successful in 18s
2025-09-04 12:44:27 +08:00
小贺
2360e0b80c 完成配置,镜像名不带端口
All checks were successful
Build and Push Docker Images / build-and-push (backend) (push) Successful in 37s
Build and Push Docker Images / build-and-push (frontend) (push) Successful in 20s
2025-09-04 12:07:54 +08:00
小贺
7878d168e0 修改8443端口
All checks were successful
Build and Push Docker Images / build-and-push (backend) (push) Successful in 18s
Build and Push Docker Images / build-and-push (frontend) (push) Successful in 18s
2025-09-04 11:37:55 +08:00
小贺
2ed19e2eab 恢复原样,测试
Some checks failed
Build and Push Docker Images / build-and-push (backend) (push) Failing after 16s
Build and Push Docker Images / build-and-push (frontend) (push) Failing after 17s
2025-09-04 11:36:02 +08:00
小贺
779c6b1ae7 使用最新buildpush,增加setup
Some checks failed
ci / docker (push) Failing after 2m3s
2025-09-04 11:31:14 +08:00
小贺
ff2b1804b4 去除注册过程
Some checks failed
ci / docker (push) Failing after 17s
2025-09-04 11:28:49 +08:00
小贺
80b201db86 又添加setup,尝试多平台构建
Some checks failed
ci / docker (push) Failing after 6m49s
2025-09-04 11:18:56 +08:00
小贺
55a1dd7d12 添加多平台构建
All checks were successful
ci / docker (push) Successful in 18s
2025-09-04 11:16:43 +08:00
小贺
3afe5c1e9e 还是不用set up buildx
All checks were successful
ci / docker (push) Successful in 13s
2025-09-04 11:14:35 +08:00
小贺
2f9ccd4db1 尝试先登录,在使用buildx
Some checks failed
ci / docker (push) Failing after 1m2s
2025-09-04 11:12:51 +08:00
小贺
ebb48e9926 测试
Some checks failed
ci / docker (push) Failing after 1m0s
2025-09-04 10:56:47 +08:00
小贺
43a081ecf2 修改key键值
Some checks failed
ci / docker (push) Failing after 1m0s
2025-09-04 10:55:26 +08:00
5 changed files with 13 additions and 53 deletions

View File

@@ -1,29 +0,0 @@
name: ci
on:
push:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: ./backend
file: ./backend/dockerfile
push: true
tags: gitea.zfxt.top/zfxt/test:v1.0
secrets: |
'token=token 7c1aca99d91e991c617d36b19f840b27e909ca92'

View File

@@ -20,21 +20,12 @@ jobs:
with: with:
fetch-depth: 0 # 获取完整的提交历史用于标签生成 fetch-depth: 0 # 获取完整的提交历史用于标签生成
-
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Registry - name: Login to Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: gitea.zfxt.top registry: gitea.zfxt.top
username: ${{ secrets.REGISTRY_USERNAME }} username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }} password: ${{ secrets.REGISTRY_PASSWORD }}
# 为后端服务生成元数据 # 为后端服务生成元数据
@@ -46,12 +37,8 @@ jobs:
images: gitea.zfxt.top/zfxt/backend images: gitea.zfxt.top/zfxt/backend
tags: | tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=sha,prefix=,suffix=,enable=true type=ref,event=tag
type=ref,event=branch
type=ref,event=pr type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# 为前端服务生成元数据 # 为前端服务生成元数据
- name: Extract metadata for frontend - name: Extract metadata for frontend
@@ -62,12 +49,8 @@ jobs:
images: gitea.zfxt.top/zfxt/frontend images: gitea.zfxt.top/zfxt/frontend
tags: | tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=sha,prefix=,suffix=,enable=true type=ref,event=tag
type=ref,event=branch
type=ref,event=pr type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# 构建和推送后端镜像 # 构建和推送后端镜像
- name: Build and push backend image - name: Build and push backend image

1
README
View File

@@ -1 +0,0 @@
第一次尝试构建CICD及完整docker镜像

7
README.md Normal file
View File

@@ -0,0 +1,7 @@
第一次尝试构建CICD及完整docker镜像
```shell
#把docker compose文件下载下来
#执行
docker compose up -d
```

View File

@@ -2,7 +2,7 @@ version: '3.8'
services: services:
frontend: frontend:
image: gitea.zfxt.top/zfxt/frontend:latest image: gitea.zfxt.top:8443/zfxt/frontend:latest
container_name: my-frontend-web container_name: my-frontend-web
ports: ports:
- "5555:5555" - "5555:5555"
@@ -13,7 +13,7 @@ services:
# 移除了build配置因为我们现在使用预构建的镜像 # 移除了build配置因为我们现在使用预构建的镜像
backend: backend:
image: gitea.zfxt.top/zfxt/backend:latest image: gitea.zfxt.top:8443/zfxt/backend:latest
container_name: my-backend-api container_name: my-backend-api
networks: networks:
- app-network - app-network