diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 00bd03a..071a755 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -13,6 +13,8 @@ permissions: jobs: build: runs-on: ubuntu-latest + env: + GITHUB_PAGES: true steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -34,3 +36,4 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + diff --git a/astro.config.mjs b/astro.config.mjs index 0409cfd..47369e8 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,10 +3,14 @@ import { defineConfig } from 'astro/config'; import react from "@astrojs/react"; import mdx from '@astrojs/mdx'; +const isProd = process.env.GITHUB_PAGES === 'true'; + export default defineConfig({ output: 'static', - site: 'https://tutorial-v2.djangogirls.org/', - base: '/', + site: isProd + ? 'https://yourname.github.io/repo-name' + : 'http://localhost:4321', + base: isProd ? '/repo-name' : '/', integrations: [ react(), mdx()