Update build.yml

This commit is contained in:
bip production
2025-02-23 11:32:14 +08:00
committed by GitHub
parent f39f63fe7a
commit b02040c157

View File

@@ -141,45 +141,6 @@ jobs:
# Source ~/.bashrc
source ~/.bashrc
# Install NVM if not already installed
if [ ! -d "$HOME/.nvm" ]; then
echo "NVM is not installed. Installing now..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
source ~/.bashrc
fi
# Verify NVM installation
if ! command -v nvm &> /dev/null; then
echo "NVM installation failed."
exit 1
fi
# Install Node.js if not already installed
if ! command -v node &> /dev/null; then
echo "Node.js is not installed. Installing now..."
nvm install --lts
nvm use --lts
fi
# Install Bun if not already installed
if ! command -v bun &> /dev/null; then
echo "Bun is not installed. Installing now..."
curl -fsSL https://bun.sh/install | bash
export PATH="$HOME/.bun/bin:$PATH"
fi
# Install PM2 if not already installed
if ! command -v pm2 &> /dev/null; then
echo "PM2 is not installed. Installing now..."
bun install --global pm2
fi
# Install dotenv-cli if not already installed
if ! command -v dotenv &> /dev/null; then
echo "dotenv-cli is not installed. Installing now..."
bun install --global dotenv-cli
fi
# Find an available port
PORT=$(curl -s -X GET https://wibu-bot.wibudev.com/api/find-port | jq -r '.[0]')
if [ -z "$PORT" ] || ! [[ "$PORT" =~ ^[0-9]+$ ]]; then
@@ -187,7 +148,7 @@ jobs:
exit 1
fi
# Deploy to VPS
# manage deployment
cd /var/www/projects/${{ env.APP_NAME }}/releases/${{ env.APP_VERSION }}
# Set environment variables