-
Notifications
You must be signed in to change notification settings - Fork 122
feat: add frontend auto-deploy config #1043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
benjamin-747
merged 7 commits into
gitmono-dev:main
from
liuyangjuncong20202570:upstream
May 23, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
66c3161
feat: add frontend auto-deploy config
liuyangjuncong20202570 0258571
feat: move build process to CI & add web-deploy config
liuyangjuncong20202570 2043296
Merge branch 'main' into upstream
genedna 1e4991b
Merge branch 'main' into upstream
genedna 2983d8e
Merge branch 'upstream' of https://github.com/liuyangjuncong20202570/…
liuyangjuncong20202570 5fc3725
Merge branch 'main' into upstream
benjamin-747 94c5986
Update moon/apps/web/next.config.js
benjamin-747 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: Web UI deploy | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - '.github/workflows/web-*.yml' | ||
| - 'moon/**' | ||
|
|
||
| env: | ||
| TIPTAP_PRIVATE_REGISTRY_KEY: ${{ secrets.TIPTAP_PRIVATE_REGISTRY_KEY }} | ||
|
|
||
| jobs: | ||
| web-ui-deploy: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.pull_request.base.ref }} | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4.0.0 | ||
| with: | ||
| version: 9 | ||
|
|
||
| - name: Get pnpm store directory | ||
| shell: bash | ||
| run: | | ||
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ env.STORE_PATH }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - run: pnpm config set "@tiptap-pro:registry" https://registry.tiptap.dev/ | ||
| - run: pnpm config set "//registry.tiptap.dev/:_authToken" ${{ secrets.TIPTAP_PRIVATE_REGISTRY_KEY }} | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ./moon | ||
| run: pnpm i --frozen-lockfile | ||
|
|
||
| - name: Run ESLint | ||
| working-directory: ./moon | ||
| run: pnpm run lint | ||
|
|
||
| - name: Build Next.js application | ||
| working-directory: ./moon | ||
| run: pnpm run build | ||
|
|
||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| aws-region: us-east-1 | ||
|
|
||
| - name: Login to Amazon ECR Public | ||
| id: login-ecr-public | ||
| uses: aws-actions/amazon-ecr-login@v2 | ||
| with: | ||
| registry-type: public | ||
|
|
||
| - name: Build, tag, and push docker image to Amazon ECR Public | ||
| working-directory: moon | ||
| env: | ||
| REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} | ||
| REGISTRY_ALIAS: m8q5m4u3 | ||
| REPOSITORY: mega-ui | ||
| IMAGE_TAG: mega-ui-0.1.0-pre-release | ||
| run: | | ||
| docker build \ | ||
| -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG . | ||
| docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| FROM node:20-alpine AS runner | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| ENV PORT=3000 | ||
|
|
||
| # 安装 pnpm(保持一致版本) | ||
| RUN corepack enable && corepack prepare pnpm@9.7.1 --activate | ||
|
|
||
| # 拷贝构建产物和依赖 | ||
| COPY . . | ||
|
|
||
| # 启动 SSR 服务 | ||
| WORKDIR /app/apps/web | ||
| CMD ["pnpm", "start"] | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import type { NextApiRequest, NextApiResponse } from 'next' | ||
|
|
||
| export default function handler(_req: NextApiRequest, res: NextApiResponse) { | ||
| res.status(200).json({ status: 'ok' }) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.