Add publish
task
Add a `publish` task to generate a production version of the website and upload it via rsync.
This commit is contained in:
parent
65a39f6325
commit
8e8a4fe980
20
run
20
run
|
@ -4,12 +4,10 @@ set -o nounset
|
|||
set -o pipefail
|
||||
|
||||
function clean {
|
||||
rm -fr node_modules/ output_*/ source/build/ vendor/
|
||||
rm -fr output_*/ source/build/
|
||||
}
|
||||
|
||||
function generate {
|
||||
rm -rf output_*/
|
||||
|
||||
local args=()
|
||||
|
||||
if [[ "${APP_ENV:-}" == "production" ]]; then
|
||||
|
@ -43,5 +41,21 @@ function npm:build:css {
|
|||
--output source/build/tailwind.css "${args[@]}"
|
||||
}
|
||||
|
||||
function publish {
|
||||
export NODE_ENV=production
|
||||
export APP_ENV=production
|
||||
|
||||
git stash
|
||||
|
||||
clean
|
||||
npm:build:css
|
||||
generate
|
||||
|
||||
rsync --archive --verbose --compress --update --delete \
|
||||
output_prod/ ssh.oliverdavies.uk:/srv/oliverdavies.uk-sculpin
|
||||
|
||||
git stash pop
|
||||
}
|
||||
|
||||
TIMEFORMAT="Task completed in %3lR"
|
||||
time "${@:-help}"
|
||||
|
|
Loading…
Reference in a new issue