From 700f25480d3bb8a8960f03a07dfd070e737e3055 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 3 Feb 2025 21:24:08 -0600 Subject: [PATCH] build: pass `site` & `base` options on build command https://docs.astro.build/en/guides/deploy/github/#configure-astro-for-github-pages --- .github/workflows/pages.yml | 5 +++-- astro.config.mjs | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d98efcf..a203df8 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -38,7 +38,8 @@ jobs: - name: Install dependencies run: npm ci - name: Build with Astro - run: BASE_URL='pokeapi.co' npm run build + # run: BASE_URL='https://pokeapi.github.io/' npm run build + run: npm run build --site 'https://pokeapi.github.io/' --base 'pokeapi.co' - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: @@ -54,4 +55,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 diff --git a/astro.config.mjs b/astro.config.mjs index 3b3f5fa..c2abbb4 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,11 +3,11 @@ import starlight from '@astrojs/starlight' import starlightOpenAPI, { openAPISidebarGroups } from 'starlight-openapi' import tailwindcss from '@tailwindcss/vite' -const base_url = process.env.BASE_URL || '' +// const base_url = process.env.BASE_URL || '' export default defineConfig({ site: 'https://pokeapi.co', - base: base_url, + base: '/pokeapi.co' integrations: [ starlight({ title: 'PokéAPI', @@ -26,7 +26,8 @@ export default defineConfig({ // Generate the OpenAPI documentation pages. starlightOpenAPI([ { - base: `${base_url}/v2/openapi`, + // base: `${base_url}/v2/openapi`, + base: `/v2/openapi`, label: 'OpenAPI', schema: 'https://raw.githubusercontent.com/PokeAPI/pokeapi/master/openapi.yml', },