ci: add github pages deploy

This commit is contained in:
2026-06-11 13:04:36 +05:00
parent d3d74abca1
commit f8df409d57
7 changed files with 67 additions and 18 deletions
+33
View File
@@ -0,0 +1,33 @@
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v6
- name: Install, build, and upload your site
uses: withastro/action@v6
env:
BASE_PATH: /lopata
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
+4
View File
@@ -2,7 +2,11 @@
import tailwindcss from "@tailwindcss/vite"; import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "astro/config"; import { defineConfig } from "astro/config";
const base = process.env.BASE_PATH || "/";
export default defineConfig({ export default defineConfig({
site: "https://Ku6epXBOCTuK.github.io",
base,
vite: { vite: {
plugins: [tailwindcss()], plugins: [tailwindcss()],
}, },
+10 -6
View File
@@ -1,17 +1,21 @@
<header class="sticky top-0 z-30 border-b border-foreground/25 bg-card/85 backdrop-blur-sm shadow-[0_2px_12px_-8px_rgba(40,25,15,0.6)]"> ---
import { base } from "../lib/paths";
---
<header
class="sticky top-0 z-30 border-b border-foreground/25 bg-card/85 backdrop-blur-sm shadow-[0_2px_12px_-8px_rgba(40,25,15,0.6)]"
>
<div class="mx-auto flex max-w-5xl flex-col gap-4 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6"> <div class="mx-auto flex max-w-5xl flex-col gap-4 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6">
<a href="/" class="flex items-center gap-3"> <a href={base} class="flex items-center gap-3">
<img <img
src="/emblem.png" src={`${base}/emblem.png`}
alt="Эмблема Трибунала" alt="Эмблема Трибунала"
width="52" width="52"
height="52" height="52"
class="h-12 w-12 mix-blend-multiply" class="h-12 w-12 mix-blend-multiply"
/> />
<div class="leading-tight"> <div class="leading-tight">
<p class="font-heading text-base font-700 uppercase tracking-wide sm:text-lg"> <p class="font-heading text-base font-700 uppercase tracking-wide sm:text-lg">Архив ДНТ-7</p>
Архив ДНТ-7
</p>
<p class="text-[0.65rem] uppercase tracking-widest text-muted-foreground"> <p class="text-[0.65rem] uppercase tracking-widest text-muted-foreground">
Межгалактическое Дачное Сопротивление Межгалактическое Дачное Сопротивление
</p> </p>
+11 -7
View File
@@ -1,27 +1,31 @@
--- ---
import '../styles/globals.css' import { base } from "../lib/paths";
import "../styles/globals.css";
interface Props { interface Props {
title: string title: string;
description?: string description?: string;
} }
const { title, description } = Astro.props as Props const { title, description } = Astro.props as Props;
--- ---
<!doctype html> <!doctype html>
<html lang="ru" class="bg-background"> <html lang="ru" class="bg-background">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href={`${base}/favicon.svg`} />
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href={`${base}/favicon.ico`} />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
<title>{title}</title> <title>{title}</title>
{description && <meta name="description" content={description} />} {description && <meta name="description" content={description} />}
<link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Oswald:wght@400;500;600;700&display=swap" rel="stylesheet" /> <link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Oswald:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
</head> </head>
<body class="font-mono antialiased"> <body class="font-mono antialiased">
<slot /> <slot />
+3 -2
View File
@@ -2,6 +2,7 @@
import Perforation from "../components/Perforation.astro"; import Perforation from "../components/Perforation.astro";
import SiteFooter from "../components/SiteFooter.astro"; import SiteFooter from "../components/SiteFooter.astro";
import SiteHeader from "../components/SiteHeader.astro"; import SiteHeader from "../components/SiteHeader.astro";
import { base } from "../lib/paths";
import BaseLayout from "./base.astro"; import BaseLayout from "./base.astro";
interface Props { interface Props {
@@ -33,7 +34,7 @@ const code = content.code;
<main class="mx-auto max-w-4xl px-4 py-8 sm:px-6"> <main class="mx-auto max-w-4xl px-4 py-8 sm:px-6">
<a <a
href="/" href={base}
class="font-heading text-xs font-600 uppercase tracking-wider text-muted-foreground hover:text-primary" class="font-heading text-xs font-600 uppercase tracking-wider text-muted-foreground hover:text-primary"
> >
← Вернуться в реестр ← Вернуться в реестр
@@ -44,7 +45,7 @@ const code = content.code;
<div class="pointer-events-none absolute right-4 top-4 sm:right-8 sm:top-10"> <div class="pointer-events-none absolute right-4 top-4 sm:right-8 sm:top-10">
<img <img
src="/emblem.png" src={`${base}/emblem.png`}
alt="" alt=""
width="90" width="90"
height="90" height="90"
+2
View File
@@ -0,0 +1,2 @@
const _base = import.meta.env.BASE_URL;
export const base = _base === "/" ? "" : _base;
+4 -3
View File
@@ -5,6 +5,7 @@ import SiteFooter from "../components/SiteFooter.astro";
import SiteHeader from "../components/SiteHeader.astro"; import SiteHeader from "../components/SiteHeader.astro";
import Stamp from "../components/Stamp.astro"; import Stamp from "../components/Stamp.astro";
import BaseLayout from "../layouts/base.astro"; import BaseLayout from "../layouts/base.astro";
import { base } from "../lib/paths";
import { REGISTRY } from "../lib/registry"; import { REGISTRY } from "../lib/registry";
const statusLabel: Record<string, string> = { const statusLabel: Record<string, string> = {
@@ -52,7 +53,7 @@ const tilts = ["-0.6deg", "0.5deg", "-0.4deg"];
<div class="pointer-events-none absolute right-4 top-4 sm:right-8 sm:top-8"> <div class="pointer-events-none absolute right-4 top-4 sm:right-8 sm:top-8">
<img <img
src="/emblem.png" src={`${base}/emblem.png`}
alt="" alt=""
width="120" width="120"
height="120" height="120"
@@ -102,7 +103,7 @@ const tilts = ["-0.6deg", "0.5deg", "-0.4deg"];
{ {
REGISTRY.filter((e) => e.status === "open").map((e, i) => ( REGISTRY.filter((e) => e.status === "open").map((e, i) => (
<a <a
href={`/docs/${e.slug}`} href={`${base}/docs/${e.slug}`}
class="paper group relative flex flex-col gap-2 p-5 transition-all duration-200 hover:-translate-y-1 hover:shadow-[0_26px_50px_-22px_rgba(40,25,15,0.7)]" class="paper group relative flex flex-col gap-2 p-5 transition-all duration-200 hover:-translate-y-1 hover:shadow-[0_26px_50px_-22px_rgba(40,25,15,0.7)]"
style={{ rotate: tilts[i] }} style={{ rotate: tilts[i] }}
> >
@@ -139,7 +140,7 @@ const tilts = ["-0.6deg", "0.5deg", "-0.4deg"];
{ {
REGISTRY.map((entry, i) => { REGISTRY.map((entry, i) => {
const isOpen = entry.status === "open"; const isOpen = entry.status === "open";
const href = isOpen ? `/docs/${entry.slug}` : undefined; const href = isOpen ? `${base}/docs/${entry.slug}` : undefined;
const Tag = isOpen ? "a" : "div"; const Tag = isOpen ? "a" : "div";
return ( return (
<Tag <Tag