Skip to content

Commit

Permalink
chore: use dynamic site url & base path
Browse files Browse the repository at this point in the history
  • Loading branch information
techfg committed Apr 6, 2024
1 parent ab76b14 commit e0dc712
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/gh-pages-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Install, build, and upload your site output
env:
SITE_URL: https://${{ github.repository.owner }}.github.io
BASE_PATH: ${{ github.event.repository.name }}
uses: withastro/action@v2
with:
path: site
Expand Down
4 changes: 2 additions & 2 deletions site/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import starlight from '@astrojs/starlight';

// https://astro.build/config
export default defineConfig({
site: 'https://techfg.github.io',
base: 'ImageMapster',
site: import.meta.env.SITE_URL || 'https://jamietre.github.io',
base: import.meta.env.BASE_PATH || 'ImageMapster',
integrations: [
starlight({
title: 'My Docs',
Expand Down
9 changes: 9 additions & 0 deletions site/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

interface ImportMetaEnv {
readonly SITE_URL: string;
readonly BASE_PATH: string;
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}

0 comments on commit e0dc712

Please sign in to comment.