updated procfile

This commit is contained in:
Jack Goh
2018-07-16 15:35:05 +08:00
parent 4a83cebad8
commit e4fa43ae0b
2 changed files with 36 additions and 2 deletions
+1 -2
View File
@@ -1,2 +1 @@
web: vendor/bin/heroku-php-apache2 public/
heroku-postbuild: npm run production
web: vendor/bin/heroku-php-apache2 public/ && npm run production
+35
View File
@@ -0,0 +1,35 @@
# Save latest Git commit message
MESSAGE=$(git log -1 --pretty=%B)
# Add it as a secret variable on CI environment
git remote set-url origin $REMOTE_REPOSITORY
git config user.email $DEPLOY_GIT_EMAIL
git config user.name $DEPLOY_GIT_USERNAME
if git ls-remote $REMOTE_REPOSITORY | grep -sw "deploy" 2>&1>/dev/null; then
git checkout . && git checkout deploy;
else
git checkout --orphan deploy;
fi
# Remove all files except .git, node_modules and vendor folder
find . -path ./.git -prune -o \( \! -path ./dist \) -prune -o \( \! -path ./vendor \) -exec rm -rf {} \; 2> /dev/null
# Add master branch files
git archive master | tar x -C .
# Generate i18n string for the front-end
composer install -n --prefer-dist
php artisan vue-i18n:generate
# Compile front-end stuff
yarn --pure-lockfile
yarn production
# Those files are ignored on master branch, force add it
git add -f public/css
git add -f public/js
# Push to the deploy branch
git add .
git commit -am "[${CI_COMMIT_SHA:0:8}]: $MESSAGE"
git push -u origin deploy