Skip to content

Commit

Permalink
build: pass site & base options on build command
Browse files Browse the repository at this point in the history
  • Loading branch information
Indyandie committed Feb 4, 2025
1 parent 45b8a1b commit 700f254
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -54,4 +55,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
7 changes: 4 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
},
Expand Down

0 comments on commit 700f254

Please sign in to comment.