Skip to content

Commit

Permalink
style: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Mar 22, 2024
1 parent 32b83f1 commit 855d86b
Show file tree
Hide file tree
Showing 25 changed files with 498 additions and 425 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/build-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -29,20 +29,20 @@ jobs:
run: echo ${{ steps.docker_build.outputs.digest }}


deploy:
runs-on: ubuntu-latest
needs: docker
steps:
- name: Deploy to remote server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USERNAME }}
password: ${{ secrets.REMOTE_PASSWORD }}
port: ${{ secrets.REMOTE_PORT }}
script: |
cd ${{ secrets.REMOTE_WORKDIR }}
pnpm docker:prod:up
docker cp ./public/ nest-admin-server:/nest-admin/public
docker image prune -f
docker container prune -f
# deploy:
# runs-on: ubuntu-latest
# needs: docker
# steps:
# - name: Deploy to remote server
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.REMOTE_HOST }}
# username: ${{ secrets.REMOTE_USERNAME }}
# password: ${{ secrets.REMOTE_PASSWORD }}
# port: ${{ secrets.REMOTE_PORT }}
# script: |
# cd ${{ secrets.REMOTE_WORKDIR }}
# pnpm docker:prod:up
# docker cp ./public/ nest-admin-server:/nest-admin/public
# docker image prune -f
# docker container prune -f
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy

on:
workflow_run:
workflows: [Sync To Gitee]
types:
- completed

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to remote server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USERNAME }}
password: ${{ secrets.REMOTE_PASSWORD }}
port: ${{ secrets.REMOTE_PORT }}
script: |
cd ${{ secrets.REMOTE_WORKDIR }}
git reset --hard origin/main
git pull
pnpm install
pnpm build
echo "${{ secrets.DEPLOY_ENV_FILE }}" > .env
echo "${{ secrets.DEPLOY_ENV_PROD_FILE }}" > .env.production
pnpm prod:pm2
6 changes: 4 additions & 2 deletions .github/workflows/sync-to-gitee.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: syncToGitee
name: Sync To Gitee

env:
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
Expand All @@ -12,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Mirror the Github organization repos to Gitee.
uses: Yikun/hub-mirror-action@master
Expand All @@ -24,3 +25,4 @@ jobs:
static_list: 'nest-admin'
force_update: true
debug: true

1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
nest-admin-server:
image: buqiyuan/nest-admin-server:stable
container_name: nest-admin-server
pull_policy: always
restart: always
env_file:
- .env
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test": "jest",
"test:watch": "jest --watch",
"doc": "compodoc -p tsconfig.json -s",
"gen-env-types": "npx tsx scripts/genEnvTypes.ts",
"gen-env-types": "npx ts-node scripts/genEnvTypes.ts",
"typeorm": "NODE_ENV=development typeorm-ts-node-esm -d ./dist/config/database.config.js",
"migration:create": "npm run typeorm migration:create ./src/migrations/initData",
"migration:generate": "npm run typeorm migration:generate ./src/migrations/update-table_$(echo $npm_package_version | sed 's/\\./_/g')",
Expand All @@ -44,27 +44,27 @@
},
"dependencies": {
"@fastify/cookie": "^9.3.1",
"@fastify/multipart": "^8.1.0",
"@fastify/multipart": "^8.2.0",
"@fastify/static": "^7.0.1",
"@liaoliaots/nestjs-redis": "^9.0.5",
"@nestjs-modules/mailer": "^1.10.3",
"@nestjs/axios": "^3.0.2",
"@nestjs/bull": "^10.1.0",
"@nestjs/cache-manager": "^2.2.1",
"@nestjs/common": "^10.3.3",
"@nestjs/common": "^10.3.4",
"@nestjs/config": "^3.2.0",
"@nestjs/core": "^10.3.3",
"@nestjs/core": "^10.3.4",
"@nestjs/event-emitter": "^2.0.4",
"@nestjs/jwt": "^10.2.0",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-fastify": "^10.3.3",
"@nestjs/platform-socket.io": "^10.3.3",
"@nestjs/platform-fastify": "^10.3.4",
"@nestjs/platform-socket.io": "^10.3.4",
"@nestjs/schedule": "^4.0.1",
"@nestjs/swagger": "^7.3.0",
"@nestjs/terminus": "^10.2.3",
"@nestjs/throttler": "^5.1.2",
"@nestjs/typeorm": "^10.0.2",
"@nestjs/websockets": "^10.3.3",
"@nestjs/websockets": "^10.3.4",
"@socket.io/redis-adapter": "^8.3.0",
"@socket.io/redis-emitter": "^5.1.0",
"@types/lodash": "^4.17.0",
Expand All @@ -86,7 +86,7 @@
"lodash": "^4.17.21",
"mysql2": "^3.9.2",
"nanoid": "^3.3.7",
"nodemailer": "^6.9.12",
"nodemailer": "^6.9.13",
"passport": "^0.7.0",
"passport-google-oauth20": "^2.0.0",
"passport-jwt": "^4.0.1",
Expand All @@ -98,22 +98,22 @@
"socket.io": "^4.7.5",
"stacktrace-js": "^2.0.2",
"svg-captcha": "^1.4.0",
"systeminformation": "^5.22.3",
"systeminformation": "^5.22.6",
"typeorm": "0.3.17",
"ua-parser-js": "^1.0.37",
"winston": "^3.12.0",
"winston-daily-rotate-file": "^5.0.0"
},
"devDependencies": {
"@antfu/eslint-config": "^2.8.3",
"@antfu/eslint-config": "^2.9.0",
"@compodoc/compodoc": "^1.1.23",
"@nestjs/cli": "^10.3.2",
"@nestjs/schematics": "^10.1.1",
"@nestjs/testing": "^10.3.2",
"@nestjs/testing": "^10.3.4",
"@types/cache-manager": "^4.0.6",
"@types/jest": "29.5.12",
"@types/multer": "^1.4.11",
"@types/node": "^20.11.25",
"@types/node": "^20.11.30",
"@types/passport-jwt": "^4.0.1",
"@types/supertest": "^6.0.2",
"@types/ua-parser-js": "^0.7.39",
Expand All @@ -128,7 +128,7 @@
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.4.2"
"typescript": "^5.4.3"
},
"pnpm": {
"overrides": {
Expand Down
Loading

0 comments on commit 855d86b

Please sign in to comment.