ci: add github pages deploy
This commit is contained in:
@@ -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
|
||||
@@ -2,7 +2,11 @@
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import { defineConfig } from "astro/config";
|
||||
|
||||
const base = process.env.BASE_PATH || "/";
|
||||
|
||||
export default defineConfig({
|
||||
site: "https://Ku6epXBOCTuK.github.io",
|
||||
base,
|
||||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
},
|
||||
|
||||
@@ -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">
|
||||
<a href="/" class="flex items-center gap-3">
|
||||
<a href={base} class="flex items-center gap-3">
|
||||
<img
|
||||
src="/emblem.png"
|
||||
src={`${base}/emblem.png`}
|
||||
alt="Эмблема Трибунала"
|
||||
width="52"
|
||||
height="52"
|
||||
class="h-12 w-12 mix-blend-multiply"
|
||||
/>
|
||||
<div class="leading-tight">
|
||||
<p class="font-heading text-base font-700 uppercase tracking-wide sm:text-lg">
|
||||
Архив ДНТ-7
|
||||
</p>
|
||||
<p class="font-heading text-base font-700 uppercase tracking-wide sm:text-lg">Архив ДНТ-7</p>
|
||||
<p class="text-[0.65rem] uppercase tracking-widest text-muted-foreground">
|
||||
Межгалактическое Дачное Сопротивление
|
||||
</p>
|
||||
|
||||
+11
-7
@@ -1,27 +1,31 @@
|
||||
---
|
||||
import '../styles/globals.css'
|
||||
import { base } from "../lib/paths";
|
||||
import "../styles/globals.css";
|
||||
|
||||
interface Props {
|
||||
title: string
|
||||
description?: string
|
||||
title: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
const { title, description } = Astro.props as Props
|
||||
const { title, description } = Astro.props as Props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="ru" class="bg-background">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="icon" type="image/svg+xml" href={`${base}/favicon.svg`} />
|
||||
<link rel="icon" href={`${base}/favicon.ico`} />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title}</title>
|
||||
{description && <meta name="description" content={description} />}
|
||||
<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=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>
|
||||
<body class="font-mono antialiased">
|
||||
<slot />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import Perforation from "../components/Perforation.astro";
|
||||
import SiteFooter from "../components/SiteFooter.astro";
|
||||
import SiteHeader from "../components/SiteHeader.astro";
|
||||
import { base } from "../lib/paths";
|
||||
import BaseLayout from "./base.astro";
|
||||
|
||||
interface Props {
|
||||
@@ -33,7 +34,7 @@ const code = content.code;
|
||||
|
||||
<main class="mx-auto max-w-4xl px-4 py-8 sm:px-6">
|
||||
<a
|
||||
href="/"
|
||||
href={base}
|
||||
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">
|
||||
<img
|
||||
src="/emblem.png"
|
||||
src={`${base}/emblem.png`}
|
||||
alt=""
|
||||
width="90"
|
||||
height="90"
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
const _base = import.meta.env.BASE_URL;
|
||||
export const base = _base === "/" ? "" : _base;
|
||||
@@ -5,6 +5,7 @@ import SiteFooter from "../components/SiteFooter.astro";
|
||||
import SiteHeader from "../components/SiteHeader.astro";
|
||||
import Stamp from "../components/Stamp.astro";
|
||||
import BaseLayout from "../layouts/base.astro";
|
||||
import { base } from "../lib/paths";
|
||||
import { REGISTRY } from "../lib/registry";
|
||||
|
||||
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">
|
||||
<img
|
||||
src="/emblem.png"
|
||||
src={`${base}/emblem.png`}
|
||||
alt=""
|
||||
width="120"
|
||||
height="120"
|
||||
@@ -102,7 +103,7 @@ const tilts = ["-0.6deg", "0.5deg", "-0.4deg"];
|
||||
{
|
||||
REGISTRY.filter((e) => e.status === "open").map((e, i) => (
|
||||
<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)]"
|
||||
style={{ rotate: tilts[i] }}
|
||||
>
|
||||
@@ -139,7 +140,7 @@ const tilts = ["-0.6deg", "0.5deg", "-0.4deg"];
|
||||
{
|
||||
REGISTRY.map((entry, i) => {
|
||||
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";
|
||||
return (
|
||||
<Tag
|
||||
|
||||
Reference in New Issue
Block a user