Skip to content

Commit

Permalink
Fix gh workflow extract UPLOAD_MODE
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdoTR committed Oct 28, 2024
1 parent 26aa15c commit dc9e290
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ jobs:
- name: Build project
run: npm run build

- name: Extract UPLOAD_MODE from .env
run: |
UPLOAD_MODE=$(grep '^[^#]*UPLOAD_MODE' .env | cut -d '=' -f2)
if [ -z "$UPLOAD_MODE" ]; then
echo "Error: UPLOAD_MODE is not set in .env."
exit 1
fi
echo "UPLOAD_MODE=$UPLOAD_MODE" >> $GITHUB_ENV
- name: Set up Environment Variables
if: ${{ env.UPLOAD_MODE == 'MAP_STORAGE' }}
run: |
Expand Down Expand Up @@ -69,14 +78,6 @@ jobs:
fi
fi
# UPLOAD_MODE only come from the .env file
UPLOAD_MODE=$(grep '^[^#]*UPLOAD_MODE' .env | cut -d '=' -f2)
if [ -z "$UPLOAD_MODE" ]; then
echo "Error: UPLOAD_MODE is not set in .env."
exit 1
fi
echo "UPLOAD_MODE=$UPLOAD_MODE" >> $GITHUB_ENV
- name: Deploy using WA Map Storage
if: ${{ env.UPLOAD_MODE == 'MAP_STORAGE' }}
run: npm run upload-only
Expand Down

0 comments on commit dc9e290

Please sign in to comment.