Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(docs): deploy targets (#9070)

Josh Corbett5436cedc1de4
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
index 01cd4e2866..931ba089dc 100644
--- a/.github/workflows/deploy-docs.yml
+++ b/.github/workflows/deploy-docs.yml
@@ -115,7 +115,7 @@ jobs:
run: pnpm build
working-directory: docs
env:
- DEPLOY_TARGET: ${{ inputs.deploy_target || 'custom' }}
+ DEPLOY_TARGET: ${{ github.event_name == 'workflow_dispatch' && inputs.deploy_target || github.ref == 'refs/heads/main' && 'ghpages' || 'custom' }}
# Upload artifact for deploy (main branch only)
- name: upload pages artifact
diff --git a/docs/src/lib/base-path.ts b/docs/src/lib/base-path.ts
new file mode 100644
index 0000000000..23042d899a
--- /dev/null
+++ b/docs/src/lib/base-path.ts
@@ -0,0 +1,6 @@
+export const withBase = (path: string, baseUrl: string) => {
+ const normalizedBase = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;
+ const normalizedPath = path.replace(/^\//, '');
+
+ return `${normalizedBase}${normalizedPath}`;
+};
diff --git a/docs/src/lib/components/DownloadOptions.astro b/docs/src/lib/components/DownloadOptions.astro
index f5d2965f1c..dfae32a491 100644
--- a/docs/src/lib/components/DownloadOptions.astro
+++ b/docs/src/lib/components/DownloadOptions.astro
@@ -1,6 +1,7 @@
---
import { LinkCard, Icon, LinkButton } from '@astrojs/starlight/components';
import { type StarlightIcon } from '@astrojs/starlight/types';
+import { withBase } from '../base-path';
type LauncherDownloadOption = {
icon: StarlightIcon;
@@ -36,8 +37,6 @@ const launcherDownloadOptions: Record<string, LauncherDownloadOption> = {
},
};
-const withBase = (path: string) => `${import.meta.env.BASE_URL}${path.replace(/^\//, '')}`;
-
const manualDownloadOptions = {
github: {
headline: 'Download from GitHub',
@@ -47,7 +46,7 @@ const manualDownloadOptions = {
docker: {
headline: 'Run with Docker',
description: 'For users who want to run Invoke without installing dependencies directly on their system.',
- href: withBase('/configuration/docker/'),
+ href: withBase('/configuration/docker/', import.meta.env.BASE_URL),
},
};
---
diff --git a/docs/src/lib/components/SystemRequirmentsLink.astro b/docs/src/lib/components/SystemRequirmentsLink.astro
index dcecc9a3e9..16455b8e74 100644
--- a/docs/src/lib/components/SystemRequirmentsLink.astro
+++ b/docs/src/lib/components/SystemRequirmentsLink.astro
@@ -1,11 +1,10 @@
---
import { LinkCard } from '@astrojs/starlight/components';
-
-const withBase = (path: string) => `${import.meta.env.BASE_URL}${path.replace(/^\//, '')}`;
+import { withBase } from '../base-path';
---
<LinkCard
title="System Requirements"
description="Please check the system requirements page to make sure your hardware is capable of running the desired models."
- href={withBase('/start-here/system-requirements/')}
+ href={withBase('/start-here/system-requirements/', import.meta.env.BASE_URL)}
/>