Compare commits
16 Commits
12b24dc890
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc721287df | ||
|
|
f609e1725f | ||
| 1bb91aab66 | |||
| a87161081b | |||
|
|
c3648d1102 | ||
|
|
2360e0b80c | ||
|
|
7878d168e0 | ||
|
|
2ed19e2eab | ||
|
|
779c6b1ae7 | ||
|
|
ff2b1804b4 | ||
|
|
80b201db86 | ||
|
|
55a1dd7d12 | ||
|
|
3afe5c1e9e | ||
|
|
2f9ccd4db1 | ||
|
|
ebb48e9926 | ||
|
|
43a081ecf2 |
@@ -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'
|
|
||||||
@@ -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
|
||||||
7
README.md
Normal file
7
README.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
第一次尝试构建CICD及完整docker镜像
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#把docker compose文件下载下来
|
||||||
|
#执行
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
@@ -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
|
||||||
@@ -21,4 +21,4 @@ services:
|
|||||||
|
|
||||||
networks:
|
networks:
|
||||||
app-network:
|
app-network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|||||||
Reference in New Issue
Block a user