Skip to content

Commit

Permalink
Merge pull request #357 from ayush-129/improve-deploy-scripts
Browse files Browse the repository at this point in the history
Improving deploy scripts
  • Loading branch information
Mr-Sunglasses authored Oct 7, 2024
2 parents 07d2e84 + bf85340 commit 64d771e
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions scripts/deploy.sh
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."

0 comments on commit 64d771e

Please sign in to comment.