# Staging daily update (dev.myedcamp.com)

Use this whenever you change code on your Mac and want it on staging.

**Staging URL:** https://dev.myedcamp.com  
**Branch:** `staging`  
**Server app path:** `/home/myedcamp/public_html/dev.myedcamp.com/apps/web`

---

## 1. On your Mac (push code)

```bash
cd /Applications/XAMPP/xamppfiles/htdocs/myEdcamp
git add .
git commit -m "your message"
git push origin staging
```

If you were working on `main`, either merge into `staging` first, or push the branch you use for staging.

---

## 2. On the server Terminal (pull + update)

In cPanel → **Terminal**:

```bash
cd /home/myedcamp/public_html/dev.myedcamp.com
git pull origin staging
cd apps/web
php /home/myedcamp/composer.phar install --no-dev --optimize-autoloader
php artisan migrate --force
```

Then open https://dev.myedcamp.com and hard-refresh if needed (**Cmd + Shift + R**).

Auth on the server should use the deploy SSH key (not a personal access token pasted into docs).

---

## Optional (only when needed)

**If CSS/JS looks broken after a frontend change** (and Node is available on the server):

```bash
cd /home/myedcamp/public_html/dev.myedcamp.com/apps/web
npm ci
npm run build
```

**If you only changed Blade/PHP and no new Composer packages**, you can skip `composer install`.

**If you only changed code with no new migrations**, you can skip `php artisan migrate --force`.

---

## Quick reference

| Place | What to do |
|--------|------------|
| Mac | `git add` → `commit` → `push origin staging` |
| Server | `git pull` → `composer install` → `migrate` |
| Browser | Check https://dev.myedcamp.com |

---

## Do not commit

- `.env` (stays only on the server / your local machine)
- Database passwords or API keys
