13 changed files with 273 additions and 184 deletions
@ -1,47 +0,0 @@ |
|||||
name: 后端部署(API,IdentityServer4,Gateways) |
|
||||
on: |
|
||||
push: |
|
||||
branches: |
|
||||
- main |
|
||||
|
|
||||
jobs: |
|
||||
build: |
|
||||
runs-on: ubuntu-latest |
|
||||
steps: |
|
||||
- uses: actions/checkout@v2 |
|
||||
- name: Install Dotnet 6.x |
|
||||
uses: actions/setup-dotnet@v1 |
|
||||
with: |
|
||||
dotnet-version: "6.0" |
|
||||
include-prerelease: True |
|
||||
- name: 编译 |
|
||||
run: dotnet build aspnet-core/Lion.AbpPro.sln |
|
||||
|
|
||||
- name: 单元测试 |
|
||||
run: dotnet test aspnet-core/services/test/Lion.AbpPro.Domain.Tests/Lion.AbpPro.Domain.Tests.csproj |
|
||||
|
|
||||
- name: 发布->Lion.AbpPro.HttpApi.Host |
|
||||
run: dotnet publish aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Lion.AbpPro.HttpApi.Host.csproj -o Lion.AbpPro.HttpApi.Host |
|
||||
|
|
||||
- name: 发布->Lion.AbpPro.WebGateway |
|
||||
run: dotnet publish aspnet-core/gateways/Lion.AbpPro.WebGateway/Lion.AbpPro.WebGateway.csproj -o Lion.AbpPro.WebGateway |
|
||||
|
|
||||
- name: 部署->Lion.AbpPro.HttpApi.Host |
|
||||
uses: easingthemes/ssh-deploy@v2.2.11 |
|
||||
env: |
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} |
|
||||
ARGS: "-avzr --delete --exclude 'appsettings.json'" |
|
||||
SOURCE: "Lion.AbpPro.HttpApi.Host" |
|
||||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} |
|
||||
REMOTE_USER: ${{ secrets.REMOTE_USER }} |
|
||||
TARGET: "/root/wwwroot" |
|
||||
|
|
||||
- name: 部署->Lion.AbpPro.WebGateway |
|
||||
uses: easingthemes/ssh-deploy@v2.2.11 |
|
||||
env: |
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} |
|
||||
ARGS: "-avzr --delete --exclude 'appsettings.json'" |
|
||||
SOURCE: "Lion.AbpPro.WebGateway" |
|
||||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} |
|
||||
REMOTE_USER: ${{ secrets.REMOTE_USER }} |
|
||||
TARGET: "/root/wwwroot" |
|
||||
@ -1,35 +0,0 @@ |
|||||
name: 前端部署(vue) |
|
||||
on: |
|
||||
push: |
|
||||
branches: |
|
||||
- main |
|
||||
|
|
||||
jobs: |
|
||||
build: |
|
||||
runs-on: ubuntu-latest |
|
||||
steps: |
|
||||
- name: Checkout |
|
||||
uses: actions/checkout@v2.3.1 |
|
||||
with: |
|
||||
persist-credentials: false |
|
||||
|
|
||||
- name: Install pnpm |
|
||||
uses: pnpm/action-setup@v2.2.2 |
|
||||
with: |
|
||||
version: 6.0.2 |
|
||||
|
|
||||
- name: 编译|发布 |
|
||||
run: | |
|
||||
cd vben28 |
|
||||
pnpm install |
|
||||
npm run build |
|
||||
|
|
||||
- name: 部署->Vue |
|
||||
uses: easingthemes/ssh-deploy@v2.2.11 |
|
||||
env: |
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} |
|
||||
ARGS: "-avzr --delete" |
|
||||
SOURCE: "vben28/dist" |
|
||||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} |
|
||||
REMOTE_USER: ${{ secrets.REMOTE_USER }} |
|
||||
TARGET: "/root/wwwroot" |
|
||||
@ -0,0 +1,52 @@ |
|||||
|
{ |
||||
|
"Logging": { |
||||
|
"LogLevel": { |
||||
|
"Default": "Information", |
||||
|
"Microsoft": "Warning", |
||||
|
"Microsoft.Hosting.Lifetime": "Information" |
||||
|
} |
||||
|
}, |
||||
|
"AllowedHosts": "*", |
||||
|
"App": { |
||||
|
"SelfUrl": "http://localhost:44314", |
||||
|
"CorsOrigins": "http://120.24.194.14:8012,http://localhost:4200,http://localhost:80" |
||||
|
}, |
||||
|
"GlobalConfiguration": { |
||||
|
}, |
||||
|
"Routes": [ |
||||
|
{ |
||||
|
"DownstreamPathTemplate": "/{url}", |
||||
|
"DownstreamScheme": "http", |
||||
|
"DownstreamHostAndPorts": [ |
||||
|
{ |
||||
|
"Host": "lion.abp.pro", |
||||
|
"Port": 8080 |
||||
|
} |
||||
|
], |
||||
|
"UpstreamPathTemplate": "/gateway/{url}", |
||||
|
"UpstreamHttpMethod": [ |
||||
|
"Get", |
||||
|
"Post", |
||||
|
"Put", |
||||
|
"Delete" |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"DownstreamPathTemplate": "/{url}", |
||||
|
"DownstreamScheme": "ws", |
||||
|
"DownstreamHostAndPorts": [ |
||||
|
{ |
||||
|
"Host": "lion.abp.pro", |
||||
|
"Port": 8080 |
||||
|
} |
||||
|
], |
||||
|
"UpstreamPathTemplate": "/ws/{url}", |
||||
|
"UpstreamHttpMethod": [ |
||||
|
"Get", |
||||
|
"Post", |
||||
|
"Put", |
||||
|
"Delete" |
||||
|
] |
||||
|
} |
||||
|
] |
||||
|
} |
||||
@ -0,0 +1,81 @@ |
|||||
|
{ |
||||
|
"Serilog": { |
||||
|
"Using": [ |
||||
|
"Serilog.Sinks.Console", |
||||
|
"Serilog.Sinks.File" |
||||
|
], |
||||
|
"MinimumLevel": { |
||||
|
"Default": "Information", |
||||
|
"Override": { |
||||
|
"Microsoft": "Information", |
||||
|
"Volo.Abp": "Information", |
||||
|
"Hangfire": "Information", |
||||
|
"DotNetCore.CAP": "Information", |
||||
|
"Serilog.AspNetCore": "Information", |
||||
|
"Microsoft.EntityFrameworkCore": "Warning", |
||||
|
"Microsoft.AspNetCore": "Information" |
||||
|
} |
||||
|
}, |
||||
|
"WriteTo": [ |
||||
|
{ |
||||
|
"Name": "Console" |
||||
|
}, |
||||
|
{ |
||||
|
"Name": "File", |
||||
|
"Args": { |
||||
|
"path": "logs/logs-.txt", |
||||
|
"rollingInterval": "Day" |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
"App": { |
||||
|
"SelfUrl": "http://localhost:44315", |
||||
|
"CorsOrigins": "http://*:*,https://*,http://*,http://localhost,http://116.205.176.173" |
||||
|
}, |
||||
|
"ConnectionStrings": { |
||||
|
"Default": "Data Source=mysql;Port=3306;Database=LionAbpProDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" |
||||
|
}, |
||||
|
"Redis": { |
||||
|
"Configuration": "redis,password=1q2w3E*,defaultdatabase=1" |
||||
|
}, |
||||
|
"Jwt": { |
||||
|
"Audience": "Lion.AbpPro", |
||||
|
"SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=", |
||||
|
"Issuer": "Lion.AbpPro", |
||||
|
"ExpirationTime": 2 |
||||
|
}, |
||||
|
"Cap": { |
||||
|
"Enabled": true, |
||||
|
"RabbitMq": { |
||||
|
"HostName": "rabbitmq", |
||||
|
"Port": 5672, |
||||
|
"UserName": "admin", |
||||
|
"Password": "1q2w3E*" |
||||
|
} |
||||
|
}, |
||||
|
"ElasticSearch": { |
||||
|
"Enabled": "false", |
||||
|
"Url": "http://es.cn", |
||||
|
"IndexFormat": "Lion.AbpPro.development.{0:yyyy.MM.dd}", |
||||
|
"UserName": "elastic", |
||||
|
"Password": "aVVhjQ95RP7nbwNy", |
||||
|
"SearchIndexFormat": "Lion.AbpPro.development*" |
||||
|
}, |
||||
|
"Consul": { |
||||
|
"Enabled": false, |
||||
|
"Host": "http://localhost:8500", |
||||
|
"Service": "Project-Service" |
||||
|
}, |
||||
|
"AliYun": { |
||||
|
"OSS": { |
||||
|
// https://help.aliyun.com/document_detail/100624.html |
||||
|
"AccessKeyId": "AccessKeyId", |
||||
|
"AccessKeySecret": "AccessKeySecret", |
||||
|
"Endpoint": "oss-cn-shenzhen.aliyuncs.com", |
||||
|
"ContainerName": "ContainerName", |
||||
|
"RegionId": "RegionId", |
||||
|
"RoleArn": "RoleArn" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
FROM mcr.microsoft.com/dotnet/aspnet:6.0 |
||||
|
|
||||
|
# 创建目录 |
||||
|
RUN mkdir /app |
||||
|
|
||||
|
COPY publish /app |
||||
|
|
||||
|
# 设置工作目录 |
||||
|
WORKDIR /app |
||||
|
|
||||
|
# 设置时区 .net6 才有这个问题 |
||||
|
ENV TZ=Asia/Shanghai |
||||
|
|
||||
|
# 设置环境变量 |
||||
|
ENV ASPNETCORE_ENVIRONMENT=Production |
||||
|
|
||||
|
ENTRYPOINT ["dotnet", "Lion.AbpPro.DbMigrator.dll"] |
||||
|
|
||||
|
|
||||
@ -0,0 +1,5 @@ |
|||||
|
{ |
||||
|
"ConnectionStrings": { |
||||
|
"Default": "Data Source=localhost;Port=3306;Database=LionAbpProDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
version: '3' |
||||
|
services: |
||||
|
mysql: |
||||
|
image: bitnami/mysql:8.0.30 |
||||
|
container_name: mysql |
||||
|
restart: always |
||||
|
environment: |
||||
|
MYSQL_ROOT_USER: "root" # 管理员账户名 |
||||
|
MYSQL_ROOT_PASSWORD: "1q2w3E*" # 管理员密码 |
||||
|
MYSQL_AUTHENTICATION_PLUGIN: "mysql_native_password" # 认证插件 |
||||
|
MYSQL_CHARACTER_SET: utf8mb4 # 默认字符集(服务器级别) |
||||
|
MYSQL_COLLATE: utf8mb4_unicode_ci # 默认排序规则(服务器级别) |
||||
|
MYSQL_ENABLE_SLOW_QUERY: 0 # 是否开启慢查询,0:不开启 1:开启 |
||||
|
MYSQL_LONG_QUERY_TIME: 5.0 # 慢查询超时时间 |
||||
|
ports: |
||||
|
- "3306:3306" |
||||
|
|
||||
|
redis: |
||||
|
image: redis:6.2.6 |
||||
|
container_name: redis |
||||
|
restart: always |
||||
|
ports: |
||||
|
- 6379:6379 |
||||
|
command: ["redis-server", "--appendonly", "yes", "--requirepass","1q2w3E*"] |
||||
|
|
||||
|
rabbitmq: |
||||
|
image: rabbitmq:3.8-management |
||||
|
container_name: rabbitmq |
||||
|
restart: always |
||||
|
ports: |
||||
|
- "5672:5672" |
||||
|
- "15672:15672" |
||||
|
environment: |
||||
|
- RABBITMQ_DEFAULT_USER=admin |
||||
|
- RABBITMQ_DEFAULT_PASS=1q2w3E* |
||||
|
|
||||
|
lion.abp.pro: |
||||
|
build: ../aspnet-core/services/host/Lion.AbpPro.HttpApi.Host |
||||
|
container_name: lion.abp.pro |
||||
|
restart: always |
||||
|
ports: |
||||
|
- "8080:80" |
||||
|
depends_on: |
||||
|
- mysql |
||||
|
- rabbitmq |
||||
|
- redis |
||||
|
- lion.abp.pro.migrator |
||||
|
links: |
||||
|
- mysql |
||||
|
- redis |
||||
|
- rabbitmq |
||||
|
|
||||
|
lion.abp.pro.migrator: |
||||
|
build: ../aspnet-core/services/src/Lion.AbpPro.DbMigrator |
||||
|
container_name: lion.abp.pro.migrator |
||||
|
depends_on: |
||||
|
- mysql |
||||
|
links: |
||||
|
- mysql |
||||
|
|
||||
|
lion.abp.pro.gateway: |
||||
|
build: ../aspnet-core/gateways/Lion.AbpPro.WebGateway |
||||
|
container_name: lion.abp.pro.gateway |
||||
|
ports: |
||||
|
- "8081:80" |
||||
|
depends_on: |
||||
|
- lion.abp.pro |
||||
|
links: |
||||
|
- lion.abp.pro |
||||
|
|
||||
|
lion.abp.pro.vben28: |
||||
|
build: ../vben28 |
||||
|
container_name: lion.abp.pro.vben28 |
||||
|
ports: |
||||
|
- "80:80" |
||||
|
depends_on: |
||||
|
- lion.abp.pro.gateway |
||||
|
links: |
||||
|
- lion.abp.pro.gateway |
||||
|
|
||||
Loading…
Reference in new issue