Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
besscroft committed Apr 3, 2024
1 parent 8793f78 commit d817e0b
Show file tree
Hide file tree
Showing 40 changed files with 6,517 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Postgre 主机
POSTGRE_HOST="localhost"
# Postgre 端口
POSTGRE_PORT=5432
# Postgre 数据库
POSTGRE_DATABASE="postgres"
# Postgre 用户名
POSTGRE_USERNAME="postgres"
# Postgre 密码
POSTGRE_PASSWORD="postgres"
10 changes: 10 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Postgre 主机
POSTGRE_HOST="db.picimpact.supabase.co"
# Postgre 端口
POSTGRE_PORT=5432
# Postgre 数据库
POSTGRE_DATABASE="postgres"
# Postgre 用户名
POSTGRE_USERNAME="postgres"
# Postgre 密码
POSTGRE_PASSWORD="postgres"
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
46 changes: 46 additions & 0 deletions .github/workflows/build-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Dev Docker Multi-arch Image CI & CD

on:
push:
branches:
- dev

jobs:
build:
name: Running Compile Nuxt3 Multi-arch Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout PicImpact
uses: actions/checkout@v4
- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm i
- name: Build Nuxt 3
run: pnpm run build
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: set_up_buildx
uses: docker/setup-buildx-action@v3
- name: Build and push dev
id: docker_build
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/picimpact:dev
46 changes: 46 additions & 0 deletions .github/workflows/build-main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Main Docker Multi-arch Image CI & CD

on:
push:
branches:
- main

jobs:
build:
name: Running Compile Nuxt3 Multi-arch Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout PicImpact
uses: actions/checkout@v4
- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm i
- name: Build Nuxt 3
run: pnpm run build
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: set_up_buildx
uses: docker/setup-buildx-action@v3
- name: Build and push latest
id: docker_build
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/picimpact:latest
46 changes: 46 additions & 0 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release Docker Multi-arch Image CI & CD

on:
push:
tags:
- 'v*'

jobs:
build:
name: Running Compile Nuxt3 Release Multi-arch Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout PicImpact
uses: actions/checkout@v4
- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm i
- name: Build Nuxt 3
run: pnpm run build
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: set_up_buildx
uses: docker/setup-buildx-action@v3
- name: Build and push version
id: docker_build
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/picimpact:${{ steps.get_version.outputs.VERSION }}
16 changes: 16 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Greetings

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "非常感谢您提交了 issues,我们很高兴能够与您一起合作解决这个问题。我们将尽快进行审核,并会在 24 小时内回复您。在此期间,如有任何问题,请随时联系我们。再次感谢您的贡献!"
pr-message: "非常感谢您提交了 pr,我们很高兴能够与您一起合并这个 pr。我们将尽快进行审核,并会在 24 小时内回复您。在此期间,如有任何问题,请随时联系我们。再次感谢您的贡献!"
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules
*.log
dist
.output
.idea/
.vercel/

# next.js
/.next/
/out/

# production
/build

# local env files
.env*.local
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
shamefully-hoist=true
strict-peer-dependencies=false
shell-emulator=true
auto-install-peers=true
public-hoist-pattern[]=*@nextui-org/*
4 changes: 4 additions & 0 deletions .stackblitzrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"installDependencies": true,
"startCommand": "pnpm run dev"
}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:18-slim AS base

ENV TZ="Asia/Shanghai"

WORKDIR /app

COPY .output /app/.output

EXPOSE 3000

CMD ["node", "/app/.output/server/index.mjs"]

MAINTAINER besscroft
Loading

0 comments on commit d817e0b

Please sign in to comment.