ci: remove workflow, add base path
This commit is contained in:
@@ -1,34 +0,0 @@
|
|||||||
name: Deploy Pages
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest # метка твоего runner'а
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
cache: npm
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
npm ci
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
- name: Deploy to /var/www/pages
|
|
||||||
run: |
|
|
||||||
if ! command -v rsync &> /dev/null; then
|
|
||||||
sudo apt-get update && sudo apt-get install -y rsync
|
|
||||||
fi
|
|
||||||
|
|
||||||
TARGET="/var/www/pages/${{ gitea.repository }}"
|
|
||||||
mkdir -p "$TARGET"
|
|
||||||
|
|
||||||
rsync -a --delete dist/ "$TARGET/"
|
|
||||||
+7
-1
@@ -1,4 +1,10 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
import { loadEnv } from 'vite'
|
||||||
import { defineConfig } from 'astro/config'
|
import { defineConfig } from 'astro/config'
|
||||||
|
|
||||||
export default defineConfig({})
|
const mode = process.argv.includes('build') ? 'production' : 'development'
|
||||||
|
const env = loadEnv(mode, process.cwd(), '')
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
base: env.PUBLIC_BASE_PATH || '/',
|
||||||
|
})
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { title, description } = Astro.props
|
const { title, description } = Astro.props
|
||||||
|
|
||||||
|
const base = import.meta.env.BASE_URL.replace(/\/+$/, '')
|
||||||
|
const faviconHref = `${base}/favicon.svg`
|
||||||
---
|
---
|
||||||
|
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
@@ -17,7 +20,7 @@ const { title, description } = Astro.props
|
|||||||
<meta name="description" content={description} />
|
<meta name="description" content={description} />
|
||||||
<meta name="theme-color" content="#090a0a" />
|
<meta name="theme-color" content="#090a0a" />
|
||||||
<meta name="color-scheme" content="dark" />
|
<meta name="color-scheme" content="dark" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href={faviconHref} />
|
||||||
<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
|
<link
|
||||||
|
|||||||
Reference in New Issue
Block a user