mirror of
https://github.com/Danneschs/platbik.git
synced 2026-08-08 01:57:37 +02:00
release config, db path in be as env var
This commit is contained in:
parent
4c75d08486
commit
141871de0d
45
.github/workflows/release.yml
vendored
Normal file
45
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
name: Build and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Frontend
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24'
|
||||
- run: npm ci
|
||||
working-directory: ./frontend
|
||||
- run: npm run build
|
||||
working-directory: ./frontend
|
||||
|
||||
# Backend
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
- run: dotnet publish backend.csproj -c Release -o ./publish
|
||||
working-directory: ./backend
|
||||
|
||||
# Create ZIP
|
||||
- name: Create Zip Archive
|
||||
run: zip -r release.zip ./frontend/dist ./publish
|
||||
|
||||
# Release
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: release.zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,7 +1,6 @@
|
||||
dist
|
||||
node_modules
|
||||
*.bak
|
||||
package-lock.json
|
||||
.idea
|
||||
bin
|
||||
obj
|
||||
|
||||
@ -72,8 +72,10 @@ public class Program
|
||||
builder.Services.AddAuthorization();
|
||||
|
||||
// Database
|
||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||
|
||||
builder.Services.AddDbContext<AppDbContext>(options =>
|
||||
options.UseSqlite("Data Source=Data/app.db"));
|
||||
options.UseSqlite(connectionString));
|
||||
|
||||
// CORS: in dev allow Vite (localhost:5173), in production allow specific domain
|
||||
var allowedOrigins = builder.Environment.IsDevelopment()
|
||||
@ -162,4 +164,4 @@ public class Program
|
||||
app.Run();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,5 +4,8 @@
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Data Source=Data/app.db"
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,27 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@bookmarks/*": ["src/bookmarks/*"],
|
||||
"@auth/*": ["src/auth/*"],
|
||||
"@objects/*": ["src/objects/*"],
|
||||
"@styles/*": ["src/styles/*"],
|
||||
"@bookmarks/*": ["./src/bookmarks/*"],
|
||||
"@auth/*": ["./src/auth/*"],
|
||||
"@objects/*": ["./src/objects/*"],
|
||||
"@styles/*": ["./src/styles/*"],
|
||||
|
||||
"@api/*": ["src/api/*"],
|
||||
"@components/*": ["src/components/*"],
|
||||
"@forms/*": ["src/components/forms/*"],
|
||||
"@tables/*": ["src/components/tables/*"],
|
||||
"@dialogs/*": ["src/components/dialogs/*"],
|
||||
"@columns/*": ["src/components/columns/*"],
|
||||
"@atoms/*": ["src/components/atoms/*"],
|
||||
"@main/*": ["src/*"],
|
||||
"@backend/*": ["backend/*"],
|
||||
"@models/*": ["backend/models/*"],
|
||||
"@routes/*": ["backend/routes/*"],
|
||||
"@mappers/*": ["src/mappers/*"],
|
||||
"@config/*": ["src/config/*"]
|
||||
"@api/*": ["./src/api/*"],
|
||||
"@components/*": ["./src/components/*"],
|
||||
"@forms/*": ["./src/components/forms/*"],
|
||||
"@tables/*": ["./src/components/tables/*"],
|
||||
"@dialogs/*": ["./src/components/dialogs/*"],
|
||||
"@columns/*": ["./src/components/columns/*"],
|
||||
"@atoms/*": ["./src/components/atoms/*"],
|
||||
"@main/*": ["./src/*"],
|
||||
"@backend/*": ["./backend/*"],
|
||||
"@models/*": ["./backend/models/*"],
|
||||
"@routes/*": ["./backend/routes/*"],
|
||||
"@mappers/*": ["./src/mappers/*"],
|
||||
"@config/*": ["./src/config/*"]
|
||||
},
|
||||
"moduleResolution": "node"
|
||||
"moduleResolution": "bundler"
|
||||
},
|
||||
"include": ["src", "backend"]
|
||||
}
|
||||
|
||||
5936
src/frontend/package-lock.json
generated
Normal file
5936
src/frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "my-app",
|
||||
"name": "platbik-fe",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
@ -36,6 +36,7 @@
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.19",
|
||||
"globals": "^15.15.0",
|
||||
"rollup-plugin-license": "^3.7.1",
|
||||
"vite": "^6.2.0",
|
||||
"vite-plugin-singlefile": "^2.2.0"
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { defineConfig } from "vite";
|
||||
import license from 'rollup-plugin-license';
|
||||
import react from "@vitejs/plugin-react";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
@ -13,7 +14,17 @@ export default defineConfig({
|
||||
build: {
|
||||
target: "esnext",
|
||||
cssCodeSplit: false,
|
||||
assetsInlineLimit: 100000000, // vše inline
|
||||
assetsInlineLimit: 100000000,
|
||||
rollupOptions: {
|
||||
plugins: [
|
||||
license({
|
||||
thirdParty: {
|
||||
// Creates licenses.txt in dist folder
|
||||
output: path.resolve(__dirname, './dist/licenses.txt'),
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
@ -40,9 +51,9 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "http://localhost:5119", // port backendu z launchSettings
|
||||
target: "http://localhost:5119", // port for backend from launchSettings
|
||||
changeOrigin: true,
|
||||
secure: false, // backend není HTTPS
|
||||
secure: false, // backend is not HTTPS
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user