| set -e | |
| if [ -z "$GITHUB_TOKEN" ]; then | |
| echo "Error: GITHUB_TOKEN is not set" | |
| exit 1 | |
| fi | |
| REPO_DIR="/app/chatlyst" | |
| if [ -d "$REPO_DIR/.git" ]; then | |
| echo "Repo exists, pulling latest changes..." | |
| cd "$REPO_DIR" | |
| git reset --hard | |
| git pull | |
| else | |
| echo "Cloning private repo..." | |
| git clone https://$GITHUB_TOKEN@github.com/reaperofssa/chatlyst.git "$REPO_DIR" | |
| cd "$REPO_DIR" | |
| fi | |
| echo "Starting server..." | |
| node app.js |