Skip to content

Commit d56ad81

Browse files
authored
Merge pull request #99 from Rabithua/develop
Develop
2 parents 19b2f82 + 308d036 commit d56ad81

58 files changed

Lines changed: 5323 additions & 886 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Deploy Rote Backend
1+
name: Deploy Rote (Backend & Frontend)
22

33
on:
44
push:
55
branches:
66
- develop
77

88
jobs:
9-
build-and-deploy:
9+
build-backend:
1010
runs-on: ubuntu-latest
1111

1212
steps:
@@ -15,20 +15,53 @@ jobs:
1515

1616
- name: Set up Docker Buildx
1717
uses: docker/setup-buildx-action@v3
18+
with:
19+
platforms: linux/amd64,linux/arm64
1820

1921
- name: Log in to Docker Hub
2022
uses: docker/login-action@v3
2123
with:
2224
username: ${{ secrets.DOCKERHUB_USERNAME }}
2325
password: ${{ secrets.DOCKERHUB_TOKEN }}
2426

25-
- name: Build and push Docker image
27+
- name: Build and push backend Docker image
2628
uses: docker/build-push-action@v5
2729
with:
2830
context: ./server
2931
file: ./server/Dockerfile
32+
platforms: linux/amd64,linux/arm64
3033
push: true
3134
tags: |
3235
${{ secrets.DOCKERHUB_USERNAME }}/rote-backend:latest-dev
3336
${{ secrets.DOCKERHUB_USERNAME }}/rote-backend:develop
3437
${{ secrets.DOCKERHUB_USERNAME }}/rote-backend:develop-${{ github.sha }}
38+
39+
build-frontend:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
46+
- name: Set up Docker Buildx
47+
uses: docker/setup-buildx-action@v3
48+
with:
49+
platforms: linux/amd64,linux/arm64
50+
51+
- name: Log in to Docker Hub
52+
uses: docker/login-action@v3
53+
with:
54+
username: ${{ secrets.DOCKERHUB_USERNAME }}
55+
password: ${{ secrets.DOCKERHUB_TOKEN }}
56+
57+
- name: Build and push frontend Docker image
58+
uses: docker/build-push-action@v5
59+
with:
60+
context: ./web
61+
file: ./web/Dockerfile
62+
platforms: linux/amd64,linux/arm64
63+
push: true
64+
tags: |
65+
${{ secrets.DOCKERHUB_USERNAME }}/rote-frontend:latest-dev
66+
${{ secrets.DOCKERHUB_USERNAME }}/rote-frontend:develop
67+
${{ secrets.DOCKERHUB_USERNAME }}/rote-frontend:develop-${{ github.sha }}
Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Deploy Rote Backend
1+
name: Release Deploy Rote (Backend & Frontend)
22

33
on:
44
push:
@@ -8,7 +8,7 @@ on:
88
types: [published]
99

1010
jobs:
11-
build-and-deploy:
11+
build-backend:
1212
runs-on: ubuntu-latest
1313

1414
steps:
@@ -17,19 +17,53 @@ jobs:
1717

1818
- name: Set up Docker Buildx
1919
uses: docker/setup-buildx-action@v3
20+
with:
21+
platforms: linux/amd64,linux/arm64
22+
23+
- name: Log in to Docker Hub
24+
uses: docker/login-action@v3
25+
with:
26+
username: ${{ secrets.DOCKERHUB_USERNAME }}
27+
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
29+
- name: Build and push backend Docker image
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: ./server
33+
file: ./server/Dockerfile
34+
platforms: linux/amd64,linux/arm64
35+
push: true
36+
tags: |
37+
${{ secrets.DOCKERHUB_USERNAME }}/rote-backend:latest
38+
${{ secrets.DOCKERHUB_USERNAME }}/rote-backend:release
39+
${{ secrets.DOCKERHUB_USERNAME }}/rote-backend:${{ github.event.release.tag_name || github.ref_name || 'main' }}
40+
41+
build-frontend:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v3
50+
with:
51+
platforms: linux/amd64,linux/arm64
2052

2153
- name: Log in to Docker Hub
2254
uses: docker/login-action@v3
2355
with:
2456
username: ${{ secrets.DOCKERHUB_USERNAME }}
2557
password: ${{ secrets.DOCKERHUB_TOKEN }}
2658

27-
- name: Build and push Docker image
59+
- name: Build and push frontend Docker image
2860
uses: docker/build-push-action@v5
2961
with:
3062
context: ./web
3163
file: ./web/Dockerfile
64+
platforms: linux/amd64,linux/arm64
3265
push: true
3366
tags: |
34-
${{ secrets.DOCKERHUB_USERNAME }}/rote-backend:latest
35-
${{ secrets.DOCKERHUB_USERNAME }}/rote-backend:${{ github.ref_type == 'tag' && github.ref_name || 'main' }}
67+
${{ secrets.DOCKERHUB_USERNAME }}/rote-frontend:latest
68+
${{ secrets.DOCKERHUB_USERNAME }}/rote-frontend:release
69+
${{ secrets.DOCKERHUB_USERNAME }}/rote-frontend:${{ github.event.release.tag_name || github.ref_name || 'main' }}

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,30 @@
88

99
## Deploy
1010

11-
To Be Continue...
11+
### 快速开始
1212

13+
#### 方式一:使用 Docker Hub 镜像(推荐)
14+
15+
```bash
16+
# 使用最新版本(默认配置文件)
17+
docker-compose up -d
18+
19+
# 使用特定版本
20+
IMAGE_TAG=v1.0.0 docker-compose up -d
21+
```
22+
23+
#### 方式二:本地构建
24+
25+
```bash
26+
# 从源码构建并启动
27+
# VITE_API_BASE 在构建时注入到前端代码中(可选,默认 http://localhost:3000)
28+
VITE_API_BASE=http://localhost:3000 docker-compose -f docker-compose.build.yml up -d --build
29+
```
30+
31+
### 详细说明
32+
33+
更多部署选项和配置说明,请查看 [Docker Compose 使用指南](doc/userguide/DOCKER-COMPOSE-GUIDE.md)
1334

1435
## Technology stack
36+
1537
![Frame 1](https://github.com/Rabithua/Rote/assets/34543831/fc00f797-82bc-47fe-8c75-36ea0b1f6f76)

0 commit comments

Comments
 (0)