Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b6a1bce7e | |||
| 2634daf800 | |||
| eeb6e5de6a | |||
| 2a9cb2b2fb |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1 +0,0 @@
|
|||||||
*.png filter=lfs diff=lfs merge=lfs -text
|
|
||||||
65
.gitea/workflows/ci.yml
Normal file
65
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
name: Portfolio CI/CD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "*" ]
|
||||||
|
tags: [ "*" ]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: '10.x'
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: dotnet restore
|
||||||
|
|
||||||
|
- name: Build Projects
|
||||||
|
run: dotnet build --configuration Release --no-restore
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: '10.x'
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: dotnet test --verbosity normal
|
||||||
|
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.leon-hoppe.de \
|
||||||
|
-u leon.hoppe --password-stdin
|
||||||
|
|
||||||
|
- name: Build backend image
|
||||||
|
run: docker build -t git.leon-hoppe.de/leon.hoppe/portfolio/backend:latest -f src/Portfolio.Api/Dockerfile .
|
||||||
|
|
||||||
|
- name: Build frontend image
|
||||||
|
run: docker build -t git.leon-hoppe.de/leon.hoppe/portfolio/frontend:latest -f src/Portfolio.Web/Dockerfile .
|
||||||
|
|
||||||
|
- name: Push backend image
|
||||||
|
run: docker push git.leon-hoppe.de/leon.hoppe/portfolio/backend:latest
|
||||||
|
|
||||||
|
- name: Push frontend image
|
||||||
|
run: docker push git.leon-hoppe.de/leon.hoppe/portfolio/frontend:latest
|
||||||
@@ -10,6 +10,6 @@ internal sealed class ProjectRepository(IHttpClientFactory factory) : IProjectRe
|
|||||||
if (!response.IsSuccessStatusCode) return [];
|
if (!response.IsSuccessStatusCode) return [];
|
||||||
|
|
||||||
var data = await response.Content.ReadFromJsonAsync<IEnumerable<Project>>(ct);
|
var data = await response.Content.ReadFromJsonAsync<IEnumerable<Project>>(ct);
|
||||||
return data ?? [];
|
return data?.OrderByDescending(p => p.OrderIndex) ?? Enumerable.Empty<Project>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ internal sealed class TimelineRepository(IHttpClientFactory factory) : ITimeline
|
|||||||
if (!result.IsSuccessStatusCode) return [];
|
if (!result.IsSuccessStatusCode) return [];
|
||||||
|
|
||||||
var data = await result.Content.ReadFromJsonAsync<IEnumerable<TimelineEntry>>(ct);
|
var data = await result.Content.ReadFromJsonAsync<IEnumerable<TimelineEntry>>(ct);
|
||||||
return data ?? [];
|
return data?.OrderBy(t => t.Date) ?? Enumerable.Empty<TimelineEntry>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<TimelineEntry>> GetFeaturedTimeline(CancellationToken ct) {
|
public async Task<IEnumerable<TimelineEntry>> GetFeaturedTimeline(CancellationToken ct) {
|
||||||
@@ -19,6 +19,6 @@ internal sealed class TimelineRepository(IHttpClientFactory factory) : ITimeline
|
|||||||
if (!result.IsSuccessStatusCode) return [];
|
if (!result.IsSuccessStatusCode) return [];
|
||||||
|
|
||||||
var data = await result.Content.ReadFromJsonAsync<IEnumerable<TimelineEntry>>(ct);
|
var data = await result.Content.ReadFromJsonAsync<IEnumerable<TimelineEntry>>(ct);
|
||||||
return data ?? [];
|
return data?.OrderBy(t => t.Date) ?? Enumerable.Empty<TimelineEntry>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user