diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index fde5836..0000000 --- a/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": [ - "@antfu", - "@unocss" - ], - "rules": { - "@typescript-eslint/ban-ts-comment":"off" - } -} diff --git a/.gitea/workflows/action.yaml b/.gitea/workflows/action.yaml new file mode 100644 index 0000000..8f9e389 --- /dev/null +++ b/.gitea/workflows/action.yaml @@ -0,0 +1,71 @@ +name: Gitea Actions Demo +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push] + +jobs: + Explore-Gitea-Actions: + runs-on: linux + # container: node:21 + # container: + # image: ghcr.nju.edu.cn/catthehacker/ubuntu:act-latest + # volumes: + # - /run/docker.sock:/run/docker.sock + # env: + # DOCKER_ORG: gitea + # DOCKER_LATEST: latest + steps: + # - run: echo "testseetsetsetstse" + # - name: To Main + # run: + # - name: Git + # run: git clone http://www.topverse.world:3000/huxin/TOPVERSE_Official /opt/workspace/website + - name: Install + run: cd /opt/workspace/TOPVERSE_Official && ./deploy.sh + # - name: Build + # run: cd /opt/workspace/TOPVERSE_Official && pnpm build + # - name: Build + # run: + + # - name: Deploy + # run: | + + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 # all history for all branches and tags + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + + # - name: Set up Docker BuildX + # uses: docker/setup-buildx-action@v3 + + # - name: Login to DockerHub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} + + # - name: Get Meta + # id: meta + # run: | + # echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT + # echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT + + # - name: Build and push + # uses: docker/build-push-action@v5 + # with: + # context: . + # file: ./Dockerfile + # platforms: | + # linux/amd64 + # linux/arm64 + # push: true + # tags: | + # ${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }} + + # - run: docker build -t website-v1:latest "." + # - run: docker rm -f website-v1 || true + # - run: docker run -d -p 19555:80 --restart=unless-stopped --name website-v1 website-v1 + # - run: docker rmi $(docker images -f "dangling=true" -q) || true + # - run: docker ps diff --git a/.vscode/settings.json b/.vscode/settings.json index 335d7cd..06bf150 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,54 @@ "*.css": "postcss" }, "editor.formatOnSave": false, - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "i18n-ally.localesPaths": [ + "locales" + ], + // Enable the ESlint flat config support + // (remove this if your ESLint extension above v3.0.5) + "eslint.experimental.useFlatConfig": true, + + // Disable the default formatter, use eslint instead + "prettier.enable": false, + "editor.formatOnSave": false, + + // Auto fix + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" + }, + + // Silent the stylistic rules in you IDE, but still auto fix them + "eslint.rules.customizations": [ + { "rule": "style/*", "severity": "off" }, + { "rule": "format/*", "severity": "off" }, + { "rule": "*-indent", "severity": "off" }, + { "rule": "*-spacing", "severity": "off" }, + { "rule": "*-spaces", "severity": "off" }, + { "rule": "*-order", "severity": "off" }, + { "rule": "*-dangle", "severity": "off" }, + { "rule": "*-newline", "severity": "off" }, + { "rule": "*quotes", "severity": "off" }, + { "rule": "*semi", "severity": "off" } + ], + + // Enable eslint for all supported languages + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml", + "toml", + "xml", + "gql", + "graphql", + "astro" + ] } diff --git a/Dockerfile b/Dockerfile index 74cf702..2baa006 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,37 @@ -FROM node:lts-alpine3.17 +FROM node:21 AS build +# 容器内的目录,通常我们会使用 app 目录 +WORKDIR /app +# 拷贝项目文件到容器/app下 +COPY . . -RUN mkdir -p /web +# ARG env_file -COPY . /web -WORKDIR /web - -RUN npm config set registry https://registry.npm.taobao.org +RUN npm config set registry https://registry.npmmirror.com RUN npm install -g pnpm +RUN pnpm config set registry https://registry.npmmirror.com +# 下载编译 RUN pnpm i -RUN pnpm build -# RUN rm -rf node_module +# RUN pnpm build +RUN pnpm generate +# RUN yarn config set registry https://registry.npmmirror.com +# RUN yarn +# RUN yarn build +# RUN yarn generate -ENV HOST 0.0.0.0 -ENV PORT 3000 -EXPOSE 3000 -CMD ["pnpm", "start"] +# nginx默认暴露80端口 +FROM nginx + +# 更换工作目录到nginx服务目录下 +WORKDIR /usr/share/nginx/html + +# 删除服务下可能存在的无用项目 +RUN rm -rf ./* + +# 复制自定义的 Nginx 配置文件 +COPY nginx.conf /etc/nginx/nginx.conf + +# 拷贝打包的文件 +COPY --from=build /app/dist . diff --git a/components/Footer.vue b/components/Footer.vue index 89447dc..1fa5cab 100644 --- a/components/Footer.vue +++ b/components/Footer.vue @@ -6,7 +6,7 @@ const footer = useFoot()