-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from ayush-129/improve-deploy-scripts
Improving deploy scripts
- Loading branch information
Showing
1 changed file
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,32 @@ | ||
cd .. | ||
pwd | ||
#!/bin/bash | ||
|
||
yarn build | ||
# Exit script if any command fails | ||
set -e | ||
|
||
netlify deploy --prod | ||
# Navigate to the parent directory | ||
echo "Navigating to the parent directory..." | ||
cd .. || { echo "Failed to change directory! Exiting..."; exit 1; } | ||
|
||
# Display the current directory | ||
echo "Current directory:" | ||
pwd || { echo "Failed to get current directory! Exiting..."; exit 1; } | ||
|
||
# Install dependencies (if necessary) and build the project | ||
echo "Running build..." | ||
if yarn build; then | ||
echo "Build succeeded." | ||
else | ||
echo "Build failed! Exiting..." | ||
exit 1 | ||
fi | ||
|
||
# Deploy the project to Netlify (production environment) | ||
echo "Deploying to Netlify..." | ||
if netlify deploy --prod; then | ||
echo "Deployment to Netlify succeeded." | ||
else | ||
echo "Deployment to Netlify failed! Exiting..." | ||
exit 1 | ||
fi | ||
|
||
echo "Deployment completed successfully." |