0
0

Compare commits

...

8 Commits

Author SHA1 Message Date
469197db32 Add release action
Some checks failed
Release / release-image (push) Failing after 2m28s
2024-01-29 16:32:46 +03:00
87f854bb15 Docker update 2024-01-29 16:32:38 +03:00
a9eb0eb37d Update dotnet-ef 2024-01-29 16:30:28 +03:00
878ef4e6d3 Set InvariantGlobalization to false 2024-01-29 16:30:07 +03:00
9a02949235 Upgrade packeges 2024-01-29 14:36:59 +03:00
4aac347867 Add yandex feed 2024-01-29 14:34:51 +03:00
Sergey Chebotar
4d1a5229e5 Styles edit 2023-06-23 06:53:44 +03:00
Sergey Chebotar
8195fd3720 Fonts edit 2023-06-23 06:28:01 +03:00
8 changed files with 106 additions and 40 deletions

View File

@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "7.0.2",
"version": "8.0.1",
"commands": [
"dotnet-ef"
]

View File

@ -0,0 +1,29 @@
name: Release
on:
push:
branches:
- "master"
workflow_dispatch:
jobs:
release-image:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Gitea Hub
uses: docker/login-action@v3
with:
registry: gitea.cebotari.ru
username: chebser
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build app
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: gitea.cebotari.ru/chebser/mydarlig-dotnet:latest

View File

@ -1,19 +1,15 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
WORKDIR /source
COPY . ./
RUN dotnet restore
RUN dotnet tool restore
RUN dotnet libman restore
RUN dotnet ef database update --context DataContext
RUN dotnet ef database update --context IdentityContext
COPY . .
RUN dotnet restore && \
dotnet tool restore && \
dotnet libman restore
RUN dotnet publish --property:OutputPath=/app
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:6.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy
EXPOSE 5000
WORKDIR /app
COPY --from=build /app/out .
COPY --from=build /app/Database ./Database
COPY --from=build /app .
ENV ASPNETCORE_ENVIRONMENT Production
ENTRYPOINT [ "dotnet", "MyDarling.dll", "--urls=http://0.0.0.0:5000" ]
ENTRYPOINT [ "./MyDarling", "--urls=http://0.0.0.0:5000" ]

View File

@ -1,20 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2">
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.2" />
<PackageReference Include="SkiaSharp" Version="2.88.3" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.1" />
<PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.7" />
</ItemGroup>
</Project>

42
Pages/Feed.xml.cshtml Normal file
View File

@ -0,0 +1,42 @@
@page "/feed.yml"
@using Microsoft.AspNetCore.Http
@using Microsoft.EntityFrameworkCore
@inject MyDarling.Models.DataContext context
@{
var p =
new { Url = "https://mydarlingunderwear.ru/", LastUpdated = DateTime.Today };
Response.ContentType = "text/xml";
var products = context.Products
.Include(b => b.Figures)
.Where(b => b.Price != 0 && b.Figures.Count > 0);
await Response.WriteAsync("<?xml version='1.0' encoding='UTF-8' ?>");
var updateDate = p.LastUpdated.ToString("yyyy-MM-dd");
}
<yml_catalog date="@updateDate">
<shop>
<name>My Darling Underwear</name>
<company>Екатерина Мануйлова</company>
<url>@p.Url</url>
<currencies>
<currency id="RUB" rate="1"></currency>
</currencies>
<categories>
<category id="1">Нижнее бельё</category>
</categories>
<offers>
@foreach (var product in products)
{
var figureUrl = $"{@p.Url}Content/{@product.Id}/{@product.Figures[0].Id}.jpg";
<offer id="@product.Id" available="true">
<url>@p.Url#@product.Id-1</url>
<price>@product.Price</price>
<currencyId>RUR</currencyId>
<categoryId>1</categoryId>
<name>@product.Name</name>
<picture>@figureUrl</picture>
</offer>
}
</offers>
</shop>
</yml_catalog>

View File

@ -24,6 +24,11 @@
<link href="/lib/fancyapps-ui/fancybox.css" rel="stylesheet" />
<link href="/css/styles.css" rel="stylesheet" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Noto+Sans&family=Noto+Sans+Mono&family=Nunito&display=swap"
rel="stylesheet">
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function (m, e, t, r, i, k, a) {

View File

@ -1,17 +1,13 @@
version: '3'
services:
my-darling:
image: gitea.cebotari.ru/chebser/mydarling-dotnet:latest
my-darling-test:
build: .
container_name: mydarling-dotnet
ports:
- "5050:5000"
- "5000:5000"
volumes:
- db:/app/Database
- content:/app/wwwroot/Content
- ./Database:/app/Database
- ./wwwroot/Content:/app/wwwroot/Content
environment:
- ADMIN_PASSWORD=He110World!
volumes:
db:
content:
- ADMIN_PASSWORD=He110World!

View File

@ -58,10 +58,10 @@
--bs-black-rgb: 0, 0, 0;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg-rgb: 255, 255, 255;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-font-sans-serif: 'Noto Sans', sans-serif;
--bs-font-monospace: 'Noto Sans Mono', monospace;
--bs-body-font-family: 'Nunito', sans-serif;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: Nunito, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
@ -380,9 +380,7 @@ select:disabled {
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
[type=submit]
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
@ -439,7 +437,6 @@ legend + * {
[type=search] {
outline-offset: -2px;
-webkit-appearance: textfield;
}
/* rtl:raw:
@ -2492,8 +2489,7 @@ textarea.form-control-lg {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
-webkit-print-color-adjust: exact;
color-adjust: exact;
-print-color-adjust: exact;
}
.form-check-input[type=checkbox] {
border-radius: 0.25em;
@ -4659,6 +4655,7 @@ textarea.form-control-lg {
.card-body {
flex: 1 1 auto;
padding: 1rem 1rem;
box-shadow: 0 4px 5px rgba(0,0,0,0.2);
}
.card-title {