added build
All checks were successful
Build and Push Image / build-and-push (push) Successful in 6m28s
All checks were successful
Build and Push Image / build-and-push (push) Successful in 6m28s
This commit is contained in:
39
.github/workflows/release.yaml
vendored
Normal file
39
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: "Build and Push Image"
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Build
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.kaisei.app
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASS }}
|
||||
|
||||
- name: Extract tag version
|
||||
id: extract_tag
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and Push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
file: Dockerfile
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
git.kaisei.app/amatsugu/azki:${{ env.VERSION }}
|
||||
git.kaisei.app/amatsugu/azki:latest
|
||||
build-args: VERSION=${{ env.VERSION }}
|
||||
@@ -1 +1,3 @@
|
||||
wwwroot
|
||||
**/wwwroot
|
||||
**/bin
|
||||
**/obj
|
||||
|
||||
@@ -101,6 +101,9 @@ public class FileScannerService(MediaService mediaService, IConfiguration config
|
||||
if (relativePath[0] == '.') //Ignore hidden folders
|
||||
continue;
|
||||
var absolutePath = Path.Combine(path, relativePath);
|
||||
var fileInfo = new FileInfo(absolutePath);
|
||||
if (fileInfo.Length == 0) //Skip invalid files
|
||||
continue;
|
||||
var isUpgrade = false;
|
||||
if (existingFiles.TryGetValue(relativePath, out var version))
|
||||
{
|
||||
@@ -129,13 +132,11 @@ public class FileScannerService(MediaService mediaService, IConfiguration config
|
||||
if (entries.Count > 0)
|
||||
{
|
||||
await mediaService.AddMediaBulkAsync(entries, cancellationToken);
|
||||
logger.LogInformation("Added {count} file entries", entries.Count);
|
||||
}
|
||||
if (upgradeEntries.Count > 0)
|
||||
{
|
||||
await mediaService.DeleteAllEntriesAsync(upgradeEntries.Select(e => e.Filepath), cancellationToken);
|
||||
await mediaService.AddMediaBulkAsync(upgradeEntries, cancellationToken);
|
||||
logger.LogInformation("Upgraded {count} file entries", upgradeEntries.Count);
|
||||
}
|
||||
return entries.Count + upgradeEntries.Count;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
# This stage is used to build the service project
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["AZKiServer/AZKi Server.csproj", "AZKiServer/"]
|
||||
|
||||
Reference in New Issue
Block a user