File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- cd ..
2- pwd
1+ #! /bin/bash
32
4- yarn build
3+ # Exit script if any command fails
4+ set -e
55
6- netlify deploy --prod
6+ # Navigate to the parent directory
7+ echo " Navigating to the parent directory..."
8+ cd .. || { echo " Failed to change directory! Exiting..." ; exit 1; }
9+
10+ # Display the current directory
11+ echo " Current directory:"
12+ pwd || { echo " Failed to get current directory! Exiting..." ; exit 1; }
13+
14+ # Install dependencies (if necessary) and build the project
15+ echo " Running build..."
16+ if yarn build; then
17+ echo " Build succeeded."
18+ else
19+ echo " Build failed! Exiting..."
20+ exit 1
21+ fi
22+
23+ # Deploy the project to Netlify (production environment)
24+ echo " Deploying to Netlify..."
25+ if netlify deploy --prod; then
26+ echo " Deployment to Netlify succeeded."
27+ else
28+ echo " Deployment to Netlify failed! Exiting..."
29+ exit 1
30+ fi
31+
32+ echo " Deployment completed successfully."
You can’t perform that action at this time.
0 commit comments