#!/bin/sh

# ---------------------
#  positioning
# ---------------------
cd /var/www/html/photogram/

# ---------------------
#  sync
# ---------------------
git reset --hard
git checkout master
git pull

# ---------------------
#  clean
# ---------------------
rm -rf ./public/dist

# ---------------------
#  build
# ---------------------
npx webpack --progress --profile --mode production

# ---------------------
#  fix-chown
# ---------------------
chown -R www-data:www-data .

# ---------------------
#  fix-chmod
# ---------------------
chmod -R 774 .
