Added ordering for timeline entries
This commit is contained in:
62
.gitea/workflows/ci.yml
Normal file
62
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
name: Portfolio CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "*" ]
|
||||
tags: [ "*" ]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||
steps:
|
||||
- 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
|
||||
container:
|
||||
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||
steps:
|
||||
- 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: Pull LFS
|
||||
run: git lfs pull
|
||||
|
||||
- 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,7 +10,7 @@ internal sealed class TimelineRepository(IHttpClientFactory factory) : ITimeline
|
||||
if (!result.IsSuccessStatusCode) return [];
|
||||
|
||||
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) {
|
||||
@@ -19,6 +19,6 @@ internal sealed class TimelineRepository(IHttpClientFactory factory) : ITimeline
|
||||
if (!result.IsSuccessStatusCode) return [];
|
||||
|
||||
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