Compare commits

...

2 Commits

Author SHA1 Message Date
671198cf98 Updated release workflow. Added docker compose for the API.
Some checks failed
ci / build-test (push) Successful in 2m6s
ci / publish-image (push) Has been skipped
release / Build & Publish Image (push) Failing after 11s
release / Create Gitea Release (push) Has been skipped
release / Deploy API (Production) (push) Has been skipped
2025-12-07 20:13:25 -05:00
cf37c2ad12 Implemented initial tag click event logic. 2025-12-07 20:04:30 -05:00
4 changed files with 82 additions and 15 deletions

View File

@@ -95,3 +95,35 @@ jobs:
"prerelease": ${GITHUB_REF_NAME##*-rc*:+false}${GITHUB_REF_NAME##*-rc*:-true}
}
JSON
deploy-api:
name: Deploy API (Production)
needs: build-and-publish-image
runs-on: [self-hosted, linux, x64, docker] # your Synology runner
environment: production # optional: add env protection rules in Gitea
steps:
- uses: actions/checkout@v4
- name: Docker login (pull private image)
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" \
| docker login "${{ secrets.REGISTRY_HOST }}" \
-u "${{ secrets.REGISTRY_USER }}" \
--password-stdin
- name: Render env file for compose
run: |
mkdir -p deploy
cat > deploy/.env <<EOF
REGISTRY=${{ secrets.REGISTRY_HOST }}
IMAGE_NS=${{ github.repository }}
TAG=${GITHUB_REF_NAME}
DB_CONN=${{ secrets.DB_CONNECTION_STRING }}
ALLOWED_ORIGINS=${{ secrets.ALLOWED_ORIGINS }}
TZ=America/Detroit
EOF
- name: Deploy (pull & up -d)
run: |
docker compose -f deploy/docker-compose.api.yml --env-file deploy/.env pull
docker compose -f deploy/docker-compose.api.yml --env-file deploy/.env up -d

View File

@@ -1,8 +1,10 @@
@using JSMR.Application.VoiceWorks.Queries.Search
@using JSMR.Domain.Enums
@using JSMR.UI.Blazor.Enums
@using JSMR.UI.Blazor.Filters
@using JSMR.UI.Blazor.Services
@using System.Globalization
@using Microsoft.AspNetCore.WebUtilities
<div class=@GetCardClasses(Product)>
<div class="j-voice-work-image-container">
@@ -33,7 +35,8 @@
<div class="j-tags">
@foreach (var tag in Product.Tags)
{
<div class="j-tag">@tag.Name</div>
@* <div class="j-tag">@tag.Name</div> *@
<ProductTag Tag="tag"></ProductTag>
}
</div>
</div>
@@ -73,20 +76,6 @@
<ProductIndicator Graphic="Graphic.Headphones" Color="ColorVarient.Blue" BackgroundColor="ColorVarient.Black"></ProductIndicator>
}
</BitStack>
@* <div class="j-product-indicators">
@if (Product.IsValid != true)
{
<ProductIndicator Graphic="Graphic.Warning" IconVarient="IconVarient.Fill" Color="ColorVarient.Orange" BackgroundColor="ColorVarient.Black"></ProductIndicator>
}
@if (Product.Favorite)
{
<ProductIndicator Graphic="Graphic.Star" Color="ColorVarient.Pink" BackgroundColor="ColorVarient.Black"></ProductIndicator>
}
@if (Product.HasTrial || Product.HasChobit)
{
<ProductIndicator Graphic="Graphic.Headphones" Color="ColorVarient.Blue" BackgroundColor="ColorVarient.Black"></ProductIndicator>
}
</div> *@
</div>
</div>

View File

@@ -0,0 +1,28 @@
@using JSMR.Application.VoiceWorks.Queries.Search
@using JSMR.UI.Blazor.Filters
@using Microsoft.AspNetCore.WebUtilities
<a class="j-tag" @onclick="@OnClick">@Tag.Name</a>
@* <MudChip T="string" Icon="@Icons.Material.Outlined.Tag" @onclick="@OnClick" Variant="@MudBlazor.Variant.Filled" Color="@MudBlazor.Color.Surface">@Tag.Name</MudChip> *@
@code {
[Inject]
protected NavigationManager NavigationManager { get; set; } = default!;
[Parameter]
public required VoiceWorkTagItem Tag { get; set; }
private void OnClick()
{
VoiceWorkFilterState state = new()
{
TagIds = [Tag.TagId]
};
//string basePath = new Uri(NavigationManager.Uri).GetLeftPart(UriPartial.Path);
string basePath = new Uri(NavigationManager.Uri).GetLeftPart(UriPartial.Authority);
string uri = QueryHelpers.AddQueryString($"{basePath}/voiceworks", state.ToQuery());
NavigationManager.NavigateTo(uri);
}
}

View File

@@ -0,0 +1,18 @@
services:
api:
image: ${REGISTRY}/${IMAGE_NS}:${TAG}
container_name: jsmr-api
restart: unless-stopped
environment:
ASPNETCORE_URLS: http://+:8080
ASPNETCORE_ENVIRONMENT: Production
ConnectionStrings__Default: ${DB_CONN}
CORS__AllowedOrigins: ${ALLOWED_ORIGINS}
TZ: ${TZ:-America/Detroit}
ports:
- "8080:8080" # or remove and put behind your Synology reverse-proxy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/health"]
interval: 10s
timeout: 3s
retries: 12