diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 0365dfa..425766c 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -29,7 +29,7 @@ jobs: uses: https://github.com/withastro/action@main env: GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }} - SITE_BASE: + SITE_BASE: / SITE_URL: https://gameflow.simeonradivoev.com with: package-manager: "bun" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 681e220..6cdbbb6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -26,7 +26,7 @@ jobs: uses: withastro/action@v4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SITE_BASE: gameflow-website + SITE_BASE: /gameflow-website SITE_URL: https://simeonradivoev.github.io with: package-manager: "bun" diff --git a/astro.config.mjs b/astro.config.mjs index bf32e7c..0607dee 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -8,7 +8,7 @@ const env = loadEnv(process.env.NODE_ENV, process.cwd(), ''); // https://astro.build/config export default defineConfig({ site: env.SITE_URL, - base: `/${env.SITE_BASE}`, + base: env.SITE_BASE, vite: { plugins: [ tailwindcss() diff --git a/src/scripts/getters.ts b/src/scripts/getters.ts index 153c1d1..62e8f9f 100644 --- a/src/scripts/getters.ts +++ b/src/scripts/getters.ts @@ -1,37 +1,29 @@ +const githubHeaders = import.meta.env.GITHUB_TOKEN + ? { + headers: { + Authorization: `Bearer ${import.meta.env.GITHUB_TOKEN}`, + }, + } + : {}; + export const repoData = await fetch( "https://api.github.com/repos/simeonradivoev/gameflow-deck", - { - headers: { - Authorization: `Bearer ${import.meta.env.GITHUB_TOKEN}`, - }, - }, + githubHeaders, ).then((res) => res.json()); export const releaseData = await fetch( "https://api.github.com/repos/simeonradivoev/gameflow-deck/releases/latest", - { - headers: { - Authorization: `Bearer ${import.meta.env.GITHUB_TOKEN}`, - }, - }, + githubHeaders, ).then((res) => res.json()); export const appContributorsData = await fetch( "https://api.github.com/repos/simeonradivoev/gameflow-deck/contributors", - { - headers: { - Authorization: `Bearer ${import.meta.env.GITHUB_TOKEN}`, - }, - }, + githubHeaders, ).then((res) => res.json()); export const storeContributorsData = await fetch( "https://api.github.com/repos/simeonradivoev/gameflow-store/contributors", - { - headers: { - Authorization: `Bearer ${import.meta.env.GITHUB_TOKEN}`, - }, - }, + githubHeaders, ).then((res) => res.json()); export const emulators = await fetch(