-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-app.sh
More file actions
executable file
·69 lines (60 loc) · 1.83 KB
/
deploy-app.sh
File metadata and controls
executable file
·69 lines (60 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
echo ""
echo "🚀 Full Project Deploy Script (with tagging)"
echo "--------------------------------------------"
# Step 1: Format and test
echo "🧹 Running format + tests..."
npm run format
npm test || { echo "❌ Tests failed. Exiting."; exit 1; }
# Step 2: Build docs
echo ""
read -p "📘 Build VitePress docs? (y/n) " confirm_build
if [[ $confirm_build == "y" ]]; then
npm run docs:build || { echo "❌ Docs build failed. Exiting."; exit 1; }
fi
# Step 3: Git status
echo ""
echo "📄 Git status:"
git status
# Step 4: Commit all changes
read -p "✏️ Enter commit message (leave blank to skip manual commit): " commit_msg
if [[ -n $commit_msg ]]; then
git add -A
git commit -m "$commit_msg" || echo "⚠️ Nothing to commit."
else
echo "⏭️ Skipping manual commit."
fi
# Step 5: Bump version with standard-version
echo ""
echo "🔖 Select version type:"
select bump in "patch" "minor" "major" "skip"; do
case $bump in
patch) npm run release:patch; break ;;
minor) npm run release:minor; break ;;
major) npm run release:major; break ;;
skip) echo "⏭️ Skipping version bump."; break ;;
*) echo "❌ Invalid option." ;;
esac
done
# Step 6: Push changes and tags
read -p "🚀 Push code and tags to origin/main? (y/n) " confirm_push
if [[ $confirm_push == "y" ]]; then
git push origin main --follow-tags
echo "✅ Code and version tags pushed!"
else
echo "🛑 Push skipped."
fi
# Step 7: Optional npm publish
read -p "📦 Publish to npm? (y/n) " confirm_publish
if [[ $confirm_publish == "y" ]]; then
npm publish --access public
echo "📦 Published to npm!"
else
echo "📦 Skipping npm publish."
fi
# Final message
echo ""
echo "🌐 Docs will auto-deploy to:"
echo " https://pedramsafaei.github.io/obscure-string/"
echo "📦 Your new package version:"
jq .version package.json