Skip to content

Commit 4ccb104

Browse files
authored
Add --mode argument to astro commands. (#1155)
1 parent 9806f7a commit 4ccb104

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

.github/workflows/build-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: make install
3333

3434
- name: Build the website
35-
run: make build
35+
run: make build MODE=production
3636

3737
- name: Set up SSH key
3838
uses: webfactory/ssh-agent@v0.9.1

.github/workflows/preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
4040
- name: Build the website
4141
run:
42-
make build PREVIEW=true
42+
make build MODE=preview
4343
SITE_URL="https://${BRANCH_NAME}.ep-preview.click"
4444

4545
- name: Set up SSH key

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ build:
2020
commands:
2121
- npm install -g pnpm@latest-10
2222
- make install
23-
- make build PREVIEW=true SITE_URL=$READTHEDOCS_CANONICAL_URL
23+
- make build MODE=preview SITE_URL=$READTHEDOCS_CANONICAL_URL
2424
- mkdir -p $READTHEDOCS_OUTPUT/html
2525
- cd dist && cp -r * $READTHEDOCS_OUTPUT/html

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ check:
4343
pnpm run astro check
4444

4545
build:
46-
pnpm build
46+
pnpm run astro build --mode $(MODE)
4747

4848
preview: RELEASES_DIR = $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases
4949
preview: TARGET = $(RELEASES_DIR)/$(TIMESTAMP)

src/pages/robots.txt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ Allow: /
1414
Sitemap: https://ep2025.europython.eu/sitemap-index.xml
1515
`;
1616

17-
const isPreview = String(import.meta.env.PREVIEW).toLowerCase() === "true";
17+
const isPreview = import.meta.env.MODE == "preview";
1818
export const GET: APIRoute = () =>
1919
new Response(isPreview ? previewRobots : prodRobots);

0 commit comments

Comments
 (0)