Skip to content
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.

git-ignoring compiled assets makes deployment with forge impossible #2

Closed
uikid opened this issue Jan 30, 2018 · 1 comment
Closed

Comments

@uikid
Copy link

uikid commented Jan 30, 2018

Hello Adam, thank you for this preset.

Adding the compiled assets to .gitignore makes the deployment with a forge setup impossible, unless the assets get compiled during deployment.

I have seen this git-ignoring in @JeffreyWay council repository too.

Do you guys compile the assets during the deployment process or how do you handle this issue?

Thank you.

@adamwathan
Copy link
Owner

Hey! Yep I compile the assets on the server, as part of my Forge deploy script.

Here's an example:

cd /home/forge/my-site.com
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader
echo "" | sudo -S service php7.0-fpm reload

php artisan migrate --force

yarn && yarn run prod

This used to be a bad idea a few years ago when npm was incredibly slow because the SSH connections on Forge could time out, but now that Yarn and newer versions of npm are much faster (and use lock files), it ends up working great.

For more important sites, I use Envoyer to deploy instead of Forge so that there's no down time, but it's the same overall process of installing my dependencies and compiling my assets directly on the server 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants