Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/astro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ permissions:

jobs:
build:
env:
DOCSEARCH_API_ID: ${{ secrets.DOCSEARCH_API_ID }}
DOCSEARCH_API_SEARCH_KEY: ${{ secrets.DOCSEARCH_API_SEARCH_KEY }}
DOCSEARCH_INDEX_NAME: ${{ secrets.DOCSEARCH_INDEX_NAME }}
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
Expand All @@ -21,6 +25,7 @@ jobs:
npm install
- name: Upload your site
uses: withastro/action@v3
with:

deploy:
needs: build
Expand Down
16 changes: 16 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ import sitemap from "@astrojs/sitemap";
import remarkMath from 'remark-math';
import rehypeMathjax from 'rehype-mathjax'
import starlightBlog from 'starlight-blog'
import starlightDocSearch from '@astrojs/starlight-docsearch';
import { loadEnv } from "vite";

const { DOCSEARCH_API_ID } = loadEnv(process.env.DOCSEARCH_API_ID, process.cwd(), "");
const { DOCSEARCH_API_SEARCH_KEY } = loadEnv(process.env.DOCSEARCH_API_SEARCH_KEY, process.cwd(), "");
const { DOCSEARCH_INDEX_NAME } = loadEnv(process.env.DOCSEARCH_INDEX_NAME, process.cwd(), "");

if (!DOCSEARCH_API_ID || !DOCSEARCH_API_SEARCH_KEY || !DOCSEARCH_INDEX_NAME){
console.error("Algolia DocSearch enviroment variables are invalid. Please check configuration!");
process.exit(1);
}

// https://astro.build/config
export default defineConfig({
Expand All @@ -24,6 +35,11 @@ export default defineConfig({
starlightLinksValidator({
errorOnRelativeLinks: true,
}),
starlightDocSearch({
appId: DOCSEARCH_API_ID,
apiKey: DOCSEARCH_API_SEARCH_KEY,
indexName: DOCSEARCH_INDEX_NAME,
}),
],
expressiveCode: {
// theme: ["github-dark", "github-light"],
Expand Down
Loading