Skip to content

Commit dc9e290

Browse files
committed
Fix gh workflow extract UPLOAD_MODE
1 parent 26aa15c commit dc9e290

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ jobs:
3131
- name: Build project
3232
run: npm run build
3333

34+
- name: Extract UPLOAD_MODE from .env
35+
run: |
36+
UPLOAD_MODE=$(grep '^[^#]*UPLOAD_MODE' .env | cut -d '=' -f2)
37+
if [ -z "$UPLOAD_MODE" ]; then
38+
echo "Error: UPLOAD_MODE is not set in .env."
39+
exit 1
40+
fi
41+
echo "UPLOAD_MODE=$UPLOAD_MODE" >> $GITHUB_ENV
42+
3443
- name: Set up Environment Variables
3544
if: ${{ env.UPLOAD_MODE == 'MAP_STORAGE' }}
3645
run: |
@@ -69,14 +78,6 @@ jobs:
6978
fi
7079
fi
7180
72-
# UPLOAD_MODE only come from the .env file
73-
UPLOAD_MODE=$(grep '^[^#]*UPLOAD_MODE' .env | cut -d '=' -f2)
74-
if [ -z "$UPLOAD_MODE" ]; then
75-
echo "Error: UPLOAD_MODE is not set in .env."
76-
exit 1
77-
fi
78-
echo "UPLOAD_MODE=$UPLOAD_MODE" >> $GITHUB_ENV
79-
8081
- name: Deploy using WA Map Storage
8182
if: ${{ env.UPLOAD_MODE == 'MAP_STORAGE' }}
8283
run: npm run upload-only

0 commit comments

Comments
 (0)