Add Gitea Actions deploy workflow and server configuration
Some checks failed
Deploy to Server / deploy (push) Failing after 1m49s

- Add basePath /admin to Next.js config for path-based routing
- Add .gitea/workflows/deploy.yml for CI/CD via Gitea Actions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Peter Meier
2026-03-15 13:52:41 +01:00
parent 11d46049d1
commit ecd257fb8f
16 changed files with 466 additions and 39 deletions

View File

@@ -645,8 +645,17 @@ export function ContentForm({
flush();
}
const onInvalid = (errs: Record<string, unknown>) => {
const firstKey = Object.keys(errs).find((k) => k !== "root" && errs[k]);
if (firstKey) {
const el = document.querySelector(`[name="${firstKey}"], [data-field="${firstKey}"]`);
if (el instanceof HTMLElement) el.scrollIntoView({ behavior: "smooth", block: "center" });
}
toast.error(t("validationErrors"));
};
return (
<form onSubmit={handleSubmit(onSubmit)} className="max-w-2xl space-y-6">
<form onSubmit={handleSubmit(onSubmit, onInvalid)} className="max-w-2xl space-y-6">
{errors.root && (
<div
className="rounded bg-red-50 p-3 text-sm text-red-700"
@@ -656,20 +665,22 @@ export function ContentForm({
</div>
)}
{showSlugField && (
<SlugField
collection={collection}
currentSlug={slug}
slugPrefix={!isEdit ? slugPrefixForCollection(collection) : undefined}
locale={locale}
register={register}
setValue={setValue}
setError={setError}
clearErrors={clearErrors}
error={errors._slug}
slugValue={watch("_slug") as string | undefined}
/>
<div data-field="_slug">
<SlugField
collection={collection}
currentSlug={slug}
slugPrefix={!isEdit ? slugPrefixForCollection(collection) : undefined}
locale={locale}
register={register}
setValue={setValue}
setError={setError}
clearErrors={clearErrors}
error={errors._slug}
slugValue={watch("_slug") as string | undefined}
/>
</div>
)}
<div>
<div data-field="_status">
<Label className="mb-1 block font-medium">{t("status")}</Label>
<Controller
name="_status"
@@ -729,7 +740,7 @@ export function ContentForm({
contentClassName="space-y-4"
>
{item.entries.map(([name, def]) => (
<div key={name} className={FIELD_BLOCK_CLASS}>
<div key={name} className={FIELD_BLOCK_CLASS} data-field={name}>
<Field
name={name}
def={def}
@@ -758,7 +769,7 @@ export function ContentForm({
locale={locale}
/>
) : (
<div key={name} className={FIELD_BLOCK_CLASS}>
<div key={name} className={FIELD_BLOCK_CLASS} data-field={name}>
<Field
name={name}
def={def as FieldDefinition}