Ajout de 2 workflows pour les merges et reviews
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
name: "Main Build Process"
|
||||
name: "Generation data pour merge sur master"
|
||||
|
||||
# Runs on main branch commits,
|
||||
# every commit in a pull request, any published release.
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
branches: ["main"]
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
asciidoc:
|
||||
name: "generate documentation"
|
||||
generateData:
|
||||
if: github.event.pull_request.merged == true
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -26,9 +26,15 @@ jobs:
|
||||
program: "asciidoctor -D docs --backend=html5 -o index.html documentation/readme.adoc"
|
||||
- name: Print execution time
|
||||
run: echo "Time ${{ steps.adocbuild.outputs.time }}"
|
||||
- name: Deploy docs to ghpages
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Doc
|
||||
path: ./docs
|
||||
retention-days: 5
|
||||
- name: build docker images
|
||||
run: docker build -t gitea.borealian.ovh/mcmuzzle/ludikzone:latest -f ./docker-prod/Dockerfile .
|
||||
- name: upload image
|
||||
run: |
|
||||
echo "${{ secrets.PERSO_GITEAPASSWORD}}" | docker login gitea.borealian.ovh --username mcmuzzle --password-stdin
|
||||
docker push gitea.borealian.ovh/mcmuzzle/ludikzone:latest
|
||||
|
||||
27
.gitea/workflows/review.yaml
Normal file
27
.gitea/workflows/review.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
name: "Generation data pour merge sur master"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
|
||||
jobs:
|
||||
|
||||
reviewProcess:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Install dependencies
|
||||
run: dotnet restore ./src/LudikZone.sln
|
||||
- name: Build
|
||||
run: dotnet build ./src/LudikZone.sln
|
||||
- name: Test with the dotnet CLI
|
||||
run: dotnet test ./src/LudikZone.sln
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -20,3 +20,4 @@ TestResults
|
||||
|
||||
#docker data
|
||||
/docker-dev/data
|
||||
/docker-prod/data
|
||||
5
docker-prod/.env
Normal file
5
docker-prod/.env
Normal file
@@ -0,0 +1,5 @@
|
||||
DB_HOST="postgresql"
|
||||
DB_PORT=5432
|
||||
DB_USER="admin"
|
||||
DB_PASSWORD="admin"
|
||||
DB_DATABASE="ludikZone"
|
||||
5
docker-prod/.env.example
Normal file
5
docker-prod/.env.example
Normal file
@@ -0,0 +1,5 @@
|
||||
DB_HOST="localhost"
|
||||
DB_PORT=5432
|
||||
DB_USER="admin"
|
||||
DB_PASSWORD="admin"
|
||||
DB_DATABASE="ludikZone"
|
||||
21
docker-prod/Dockerfile
Normal file
21
docker-prod/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["src/LudikZoneBlazor/LudikZoneBlazor.csproj", "src/LudikZoneBlazor/LudikZoneBlazor.csproj"]
|
||||
RUN dotnet restore "src/LudikZoneBlazor/LudikZoneBlazor.csproj"
|
||||
COPY src src
|
||||
RUN ls -a -l
|
||||
RUN dotnet build "src/LudikZoneBlazor/LudikZoneBlazor.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
WORKDIR /src
|
||||
RUN dotnet publish "src/LudikZoneBlazor/LudikZoneBlazor.csproj" -c Release -o /app/publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "LudikZoneBlazor.dll"]
|
||||
24
docker-prod/compose.yml
Normal file
24
docker-prod/compose.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
services:
|
||||
postgresql:
|
||||
image: postgres:16
|
||||
ports:
|
||||
- "${DB_PORT:-5432}:5432"
|
||||
volumes:
|
||||
- ./data/postgres/:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_DB=${DB_DATABASE:-ludikZone}
|
||||
- POSTGRES_USER=${DB_USER:-admin}
|
||||
- POSTGRES_PASSWORD=${DB_PASSWORD:-admin}
|
||||
|
||||
ludikzone:
|
||||
image: gitea.borealian.ovh/mcmuzzle/ludikzone:latest
|
||||
ports:
|
||||
- 8080:8080
|
||||
environment:
|
||||
- DB_HOST=${DB_HOST:-"postgresql"}
|
||||
- DB_PORT=${DB_PORT:-5432}
|
||||
- DB_USER=${DB_USER:-"admin"}
|
||||
- DB_PASSWORD=${DB_PASSWORD:-"admin"}
|
||||
- DB_DATABASE=${DB_DATABASE:-"ludikZone"}
|
||||
depends_on:
|
||||
- postgresql
|
||||
@@ -7,10 +7,6 @@
|
||||
<UserSecretsId>aspnet-LudikZoneBlazor-b18f2a2e-d082-4232-8521-6cacaa2a4ba2</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Data\app.db" CopyToOutputDirectory="PreserveNewest" ExcludeFromSingleFile="true" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.*" />
|
||||
|
||||
@@ -74,4 +74,11 @@ app.MapRazorComponents<App>()
|
||||
// Add additional endpoints required by the Identity /Account Razor components.
|
||||
app.MapAdditionalIdentityEndpoints();
|
||||
|
||||
// Appliquer les migrations automatiquement lors du démarrage
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
dbContext.Database.Migrate(); // Applique les migrations
|
||||
}
|
||||
|
||||
app.Run();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "DataSource=Data\\app.db;Cache=Shared"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "host=localhost;username=admin;database=ludikZone;Pooling=false;Timeout=300;CommandTimeout=300;Port=5432;"
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
Reference in New Issue
Block a user