Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 09afc48

Browse files
committed
Update deployment workflow to set backend URL based on branch
1 parent baecb7f commit 09afc48

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to S3 and CloudFront
1+
name: Beejho Frontend
22

33
on:
44
push:
@@ -23,8 +23,21 @@ jobs:
2323
- name: Install Dependencies
2424
run: pnpm install
2525

26+
- name: Determine Environment
27+
run: |
28+
if [[ $GITHUB_REF == refs/heads/main ]]; then
29+
VITE_BACKEND_URL="https://api.beejho.in"
30+
elif [[ $GITHUB_REF == refs/heads/stage ]]; then
31+
VITE_BACKEND_URL="https://stg-api.beejho.in"
32+
else
33+
VITE_BACKEND_URL="https://dev-api.beejho.in"
34+
fi
35+
echo "VITE_BACKEND_URL=$VITE_BACKEND_URL" >> $GITHUB_ENV
36+
2637
- name: Build Project
2738
run: pnpm build
39+
env:
40+
VITE_BACKEND_URL: ${{ env.VITE_BACKEND_URL }}
2841

2942
- name: Upload Build Artifacts
3043
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)