Skip to content

Commit 81b3397

Browse files
committed
update README.md
1 parent 5e0058d commit 81b3397

File tree

4 files changed

+138
-59
lines changed

4 files changed

+138
-59
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: "Docker buildx and push"
2+
description: "Buildx and push the Docker image."
3+
4+
inputs:
5+
ghcr-token:
6+
description: Token of current GitHub account in GitHub container registry.
7+
required: false
8+
default: ""
9+
dockerhub-user:
10+
description: "User name for the DockerHub account"
11+
required: false
12+
default: ""
13+
dockerhub-token:
14+
description: Token for the DockerHub account
15+
required: false
16+
default: ""
17+
f2c-registry-user:
18+
description: "User name of Fit2Cloud Docker Registry."
19+
required: false
20+
default: ""
21+
f2c-registry-token:
22+
description: "Token of Fit2Cloud Docker Registry."
23+
required: false
24+
default: ""
25+
push:
26+
description: Should push the docker image or not.
27+
required: false
28+
default: "false"
29+
platforms:
30+
description: Target platforms for building image
31+
required: false
32+
default: "linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x"
33+
image-name:
34+
description: The basic name of docker.
35+
required: false
36+
default: "upage"
37+
38+
runs:
39+
using: "composite"
40+
steps:
41+
- name: Docker meta for UPage
42+
id: meta
43+
uses: docker/metadata-action@v5
44+
with:
45+
images: |
46+
ghcr.io/${{ github.repository_owner }}/${{ inputs.image-name }}
47+
halohub/${{ inputs.image-name }}
48+
registry.fit2cloud.com/halo/${{ inputs.image-name }}
49+
tags: |
50+
type=schedule,pattern=nightly-{{date 'YYYYMMDD'}},enabled=${{ github.event_name == 'schedule' }}
51+
type=ref,event=branch,enabled=${{ github.event_name == 'push' }}
52+
type=ref,event=pr,enabled=${{ github.event_name == 'pull_request' }}
53+
type=semver,pattern={{major}}
54+
type=semver,pattern={{major}}.{{minor}}
55+
type=semver,pattern={{ version }}
56+
type=sha,enabled=${{ github.event_name == 'push' }}
57+
flavor: |
58+
latest=false
59+
- name: Set up QEMU
60+
uses: docker/setup-qemu-action@v3
61+
- name: Set up Docker Buildx
62+
uses: docker/setup-buildx-action@v3
63+
- name: Login to GHCR
64+
uses: docker/login-action@v3
65+
if: inputs.ghcr-token != '' && github.event_name != 'pull_request'
66+
with:
67+
registry: ghcr.io
68+
username: ${{ github.repository_owner }}
69+
password: ${{ inputs.ghcr-token }}
70+
- name: Login to DockerHub
71+
if: inputs.dockerhub-token != '' && github.event_name != 'pull_request'
72+
uses: docker/login-action@v3
73+
with:
74+
username: ${{ inputs.dockerhub-user }}
75+
password: ${{ inputs.dockerhub-token }}
76+
- name: Login to Fit2Cloud Docker Registry
77+
if: inputs.f2c-registry-token != '' && github.event_name != 'pull_request'
78+
uses: docker/login-action@v3
79+
with:
80+
registry: registry.fit2cloud.com
81+
username: ${{ inputs.f2c-registry-user }}
82+
password: ${{ inputs.f2c-registry-token }}
83+
- name: Build and push
84+
uses: docker/build-push-action@v5
85+
with:
86+
context: .
87+
file: ./Dockerfile
88+
platforms: ${{ inputs.platforms }}
89+
labels: ${{ steps.meta.outputs.labels }}
90+
tags: ${{ steps.meta.outputs.tags }}
91+
push: ${{ (inputs.ghcr-token != '' || inputs.dockerhub-token != '') && inputs.push == 'true' }}

.github/workflows/docker.yaml

Lines changed: 18 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ on:
1313
release:
1414
types:
1515
- published
16-
workflow_dispatch:
1716

1817
concurrency:
19-
group: ${{ github.workflow }}-${{ github.ref }}
18+
group: ${{github.workflow}} - ${{github.ref}}
2019
cancel-in-progress: true
2120

2221
permissions:
@@ -27,63 +26,25 @@ env:
2726
REGISTRY: ghcr.io
2827

2928
jobs:
30-
docker-build-publish:
29+
docker-build-and-push:
30+
if: always() && needs.build.result == 'success' && (github.event_name == 'push' || github.event_name == 'release')
3131
runs-on: ubuntu-latest
32-
timeout-minutes: 30
32+
needs: build
3333
steps:
34-
- name: Checkout code
35-
uses: actions/checkout@v4
36-
37-
- name: Set up Docker Buildx
38-
uses: docker/setup-buildx-action@v3
39-
40-
- name: Log in to GitHub Container Registry
41-
uses: docker/login-action@v3
42-
with:
43-
registry: ${{ env.REGISTRY }}
44-
username: ${{ github.actor }}
45-
password: ${{ secrets.GITHUB_TOKEN }}
46-
47-
- name: Set image name based on event
48-
id: set-image-name
49-
run: |
50-
if [[ "${{ github.event_name }}" == "release" ]]; then
51-
echo "IMAGE_NAME=${{ github.repository_owner }}/upage" >> $GITHUB_ENV
52-
echo "Using production image name: ${{ github.repository_owner }}/upage"
53-
else
54-
echo "IMAGE_NAME=${{ github.repository_owner }}/upage-dev" >> $GITHUB_ENV
55-
echo "Using development image name: ${{ github.repository_owner }}/upage-dev"
56-
fi
57-
58-
- name: Extract metadata for Docker image
59-
id: meta
60-
uses: docker/metadata-action@v4
34+
- uses: actions/checkout@v4
35+
- name: Download Artifacts
36+
uses: actions/download-artifact@v4
6137
with:
62-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
63-
tags: |
64-
type=raw,value=latest
65-
type=sha,format=short
66-
type=raw,value=${{ github.ref_name }}
67-
68-
- name: Build and push Docker image
69-
uses: docker/build-push-action@v6
38+
name: upage-artifacts
39+
path: application/build/libs
40+
- name: Docker Buildx and Push
41+
uses: ./.github/actions/docker-buildx-push
7042
with:
71-
context: .
72-
platforms: linux/amd64,linux/arm64
73-
target: upage-ai-production
43+
image-name: ${{ github.event_name == 'release' && 'upage' || 'upage-dev' }}
44+
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
45+
dockerhub-user: ${{ secrets.DOCKER_USERNAME }}
46+
dockerhub-token: ${{ secrets.DOCKER_TOKEN }}
47+
f2c-registry-user: ${{ secrets.F2C_REGISTRY_USER }}
48+
f2c-registry-token: ${{ secrets.F2C_REGISTRY_TOKEN }}
7449
push: true
75-
tags: ${{ steps.meta.outputs.tags }}
76-
labels: ${{ steps.meta.outputs.labels }}
77-
build-args: |
78-
NODE_OPTIONS="--max-old-space-size=4096"
79-
80-
- name: Check manifest
81-
run: docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
82-
83-
- name: Show build logs and system resources
84-
if: success() || failure()
85-
run: |
86-
echo "::group::System Resources"
87-
free -h
88-
df -h
89-
echo "::endgroup::"
50+
platforms: linux/amd64,linux/arm64/v8,linux/ppc64le,linux/s390x

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
<h1 align="center">UPage</h1>
2+
<h3 align="center">基于人工智能的可视化网页构建平台</h3>
23

3-
UPage 是基于人工智能的可视化网页构建平台,支持多种 AI 提供商集成,能够轻松创建和定制网页内容。
4+
<p align="center">
5+
<a href="https://github.com/halo-dev/upage/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/halo-dev/upage.svg?style=flat-square&include_prereleases" /></a>
6+
<a href="https://github.com/halo-dev/upage/commits"><img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/halo-dev/upage.svg?style=flat-square" /></a>
7+
<a href="https://github.com/halo-dev/upage/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/halo-dev/upage/halo.yaml?branch=main&style=flat-square" /></a>
8+
</p>
9+
10+
------------------------------
11+
12+
UPage 是一款基于人工智能的可视化网页构建平台,支持多种 AI 提供商集成,快速实现定制化网页。
413

514
------------------------------
615

716
特别感谢 [bolt.diy](https://github.com/stackblitz-labs/bolt.diy) 项目,UPage 的实现基于该项目的代码结构。
817

918
------------------------------
19+
20+
## 快速开始
21+
22+
UPage 提供基于 Docker 的部署方案,可以使用以下脚本进行快速部署:
23+
24+
```bash
25+
docker run -d \
26+
--name upage \
27+
--restart unless-stopped \
28+
-p 3000:3000 \
29+
-e LLM_DEFAULT_PROVIDER=OpenAILike \
30+
-e OPENAI_LIKE_API_KEY=your-openai-like-api-key \
31+
-e LLM_DEFAULT_MODEL=your-default-model \
32+
-e LLM_MINOR_MODEL=your-minor-model \
33+
-v ./logs:/app/logs \
34+
-v ./storage:/app/storage \
35+
ghcr.io/halo-dev/upage:latest
36+
```

docker-compose-prod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
depends_on:
55
postgres:
66
condition: service_healthy
7-
image: ghcr.io/lxware-dev/upage:latest
7+
image: ghcr.io/halo-dev/upage:latest
88
restart: unless-stopped
99
ports:
1010
- "${PORT:-3000}:3000"

0 commit comments

Comments
 (0)