diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 96fbbef87..1c6a8ddbc 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -32,7 +32,7 @@ jobs: run: make install - name: Build the website - run: make build + run: make build MODE=production - name: Set up SSH key uses: webfactory/ssh-agent@v0.9.1 diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 36a27f899..8763eca23 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -39,7 +39,7 @@ jobs: - name: Build the website run: - make build PREVIEW=true + make build MODE=preview SITE_URL="https://${BRANCH_NAME}.ep-preview.click" - name: Set up SSH key diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d4040f59c..107448844 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -20,6 +20,6 @@ build: commands: - npm install -g pnpm@latest-10 - make install - - make build PREVIEW=true SITE_URL=$READTHEDOCS_CANONICAL_URL + - make build MODE=preview SITE_URL=$READTHEDOCS_CANONICAL_URL - mkdir -p $READTHEDOCS_OUTPUT/html - cd dist && cp -r * $READTHEDOCS_OUTPUT/html diff --git a/Makefile b/Makefile index acf7bfc2e..37b1b7c9a 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ check: pnpm run astro check build: - pnpm build + pnpm run astro build --mode $(MODE) preview: RELEASES_DIR = $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases preview: TARGET = $(RELEASES_DIR)/$(TIMESTAMP) diff --git a/src/pages/robots.txt.ts b/src/pages/robots.txt.ts index 6ce8b0465..ef1117032 100644 --- a/src/pages/robots.txt.ts +++ b/src/pages/robots.txt.ts @@ -14,6 +14,6 @@ Allow: / Sitemap: https://ep2025.europython.eu/sitemap-index.xml `; -const isPreview = String(import.meta.env.PREVIEW).toLowerCase() === "true"; +const isPreview = import.meta.env.MODE == "preview"; export const GET: APIRoute = () => new Response(isPreview ? previewRobots : prodRobots);