-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23810d6
commit 837dcd4
Showing
14 changed files
with
231 additions
and
218 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,67 +1,67 @@ | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_docker: | ||
name: Build Docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
platforms: linux/amd64 | ||
tags: | | ||
${{ vars.DOCKERHUB_USERNAME }}/${{ vars.IMAGE_NAME }}:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
build_docker_acr: | ||
name: Build Docker ACR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Login to ACR | ||
uses: aliyun/acr-login@v1 | ||
with: | ||
login-server: https://${{ vars.REGISTRY_ADDRESS }} | ||
username: "${{ vars.REGISTRY_USERNAME }}" | ||
password: "${{ secrets.REGISTRY_PASSWORD }}" | ||
- name: Build and push image | ||
run: | | ||
docker build -t ${{ vars.REGISTRY_ADDRESS }}/${{ vars.REGISTRY_NAMESPACE }}/${{ vars.IMAGE_NAME }}:latest . | ||
docker push ${{ vars.REGISTRY_ADDRESS }}/${{ vars.REGISTRY_NAMESPACE }}/${{ vars.IMAGE_NAME }}:latest | ||
deploy: | ||
name: Deploy | ||
needs: [build_docker, build_docker_acr] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH To Host | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USER }} | ||
key: ${{ secrets.SSH_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd ${{ secrets.PROJECT_PATH }} | ||
sudo bash ./deploy.sh | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_docker: | ||
name: Build Docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
platforms: linux/amd64 | ||
tags: | | ||
${{ vars.DOCKERHUB_USERNAME }}/${{ vars.IMAGE_NAME }}:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
build_docker_acr: | ||
name: Build Docker ACR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Login to ACR | ||
uses: aliyun/acr-login@v1 | ||
with: | ||
login-server: https://${{ vars.REGISTRY_ADDRESS }} | ||
username: "${{ vars.REGISTRY_USERNAME }}" | ||
password: "${{ secrets.REGISTRY_PASSWORD }}" | ||
- name: Build and push image | ||
run: | | ||
docker build -t ${{ vars.REGISTRY_ADDRESS }}/${{ vars.REGISTRY_NAMESPACE }}/${{ vars.IMAGE_NAME }}:latest . | ||
docker push ${{ vars.REGISTRY_ADDRESS }}/${{ vars.REGISTRY_NAMESPACE }}/${{ vars.IMAGE_NAME }}:latest | ||
deploy: | ||
name: Deploy | ||
needs: [build_docker, build_docker_acr] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH To Host | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USER }} | ||
key: ${{ secrets.SSH_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd ${{ secrets.PROJECT_PATH }} | ||
sudo bash ./deploy.sh |
This file contains 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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
name: Dry Build | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
dry_build: | ||
name: Dry Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
- run: pnpm i --frozen-lockfile | ||
name: Dry Build | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
dry_build: | ||
name: Dry Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
- run: pnpm i --frozen-lockfile | ||
- run: pnpm run build |
This file contains 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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
{ | ||
"MicroPython.executeButton": [ | ||
{ | ||
"text": "▶", | ||
"tooltip": "运行", | ||
"alignment": "left", | ||
"command": "extension.executeFile", | ||
"priority": 3.5 | ||
} | ||
], | ||
"MicroPython.syncButton": [ | ||
{ | ||
"text": "$(sync)", | ||
"tooltip": "同步", | ||
"alignment": "left", | ||
"command": "extension.execute", | ||
"priority": 4 | ||
} | ||
] | ||
{ | ||
"MicroPython.executeButton": [ | ||
{ | ||
"text": "▶", | ||
"tooltip": "运行", | ||
"alignment": "left", | ||
"command": "extension.executeFile", | ||
"priority": 3.5 | ||
} | ||
], | ||
"MicroPython.syncButton": [ | ||
{ | ||
"text": "$(sync)", | ||
"tooltip": "同步", | ||
"alignment": "left", | ||
"command": "extension.execute", | ||
"priority": 4 | ||
} | ||
] | ||
} |
This file contains 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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Vastsea | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
MIT License | ||
Copyright (c) 2024 Vastsea | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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 |
---|---|---|
@@ -1,46 +1,46 @@ | ||
FROM node:18-alpine AS base | ||
|
||
FROM base AS deps | ||
RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
|
||
COPY package.json pnpm-lock.yaml ./ | ||
RUN \ | ||
if [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
|
||
FROM base AS builder | ||
WORKDIR /app | ||
COPY --from=deps /app/node_modules ./node_modules | ||
COPY . . | ||
|
||
RUN \ | ||
if [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV=production | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
COPY --from=builder /app/public ./public | ||
|
||
RUN mkdir .next | ||
RUN chown nextjs:nodejs .next | ||
|
||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
|
||
ENV PORT=3000 | ||
|
||
ENV HOSTNAME="0.0.0.0" | ||
FROM node:18-alpine AS base | ||
FROM base AS deps | ||
RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
COPY package.json pnpm-lock.yaml ./ | ||
RUN \ | ||
if [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
FROM base AS builder | ||
WORKDIR /app | ||
COPY --from=deps /app/node_modules ./node_modules | ||
COPY . . | ||
RUN \ | ||
if [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
FROM base AS runner | ||
WORKDIR /app | ||
ENV NODE_ENV=production | ||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
COPY --from=builder /app/public ./public | ||
RUN mkdir .next | ||
RUN chown nextjs:nodejs .next | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static | ||
USER nextjs | ||
EXPOSE 3000 | ||
ENV PORT=3000 | ||
ENV HOSTNAME="0.0.0.0" | ||
CMD ["node", "server.js"] |
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"Metadata": { | ||
"title":"Home | TeamVastsea", | ||
"description": "" | ||
} | ||
{ | ||
"Metadata": { | ||
"title":"Home | TeamVastsea", | ||
"description": "" | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"Metadata": { | ||
"title":"首页 | 瀚海工艺", | ||
"description": "" | ||
} | ||
{ | ||
"Metadata": { | ||
"title":"首页 | 瀚海工艺", | ||
"description": "" | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import createNextIntlPlugin from 'next-intl/plugin'; | ||
|
||
const withNextIntl = createNextIntlPlugin(); | ||
import type { NextConfig } from "next"; | ||
|
||
const nextConfig: NextConfig = { | ||
output: "standalone", | ||
}; | ||
|
||
import createNextIntlPlugin from 'next-intl/plugin'; | ||
|
||
const withNextIntl = createNextIntlPlugin(); | ||
import type { NextConfig } from "next"; | ||
|
||
const nextConfig: NextConfig = { | ||
output: "standalone", | ||
}; | ||
|
||
export default withNextIntl(nextConfig); |
Oops, something went wrong.