NAME
Giblog::Command::publish - Website publish command
DESCRIPTION
Giblog::Command::publish is website publish command.
USAGE
giblog publish REMOTE_REPOSITORY BRANCH
giblog publish --build REMOTE_REPOSITORY BRANCH
METHODS
Giblog::Command::publish inherits all methods from Giblog::Command and implements the following new ones.
run
$command->run($remote_repository, $branch);
$command->run('--build', $remote_repository, $branch);
Publish your website by specifing remote repository name and branch name.
This is the same as the following command. In this example, the repository name is origin and the branch name is main. YY-mm-dd HH:MM:SS is current date and time.
git -C public add --all
git -C public commit -m "Published by Giblog at YY-mm-dd HH:MM:SS"
git -C public push -f origin main
When you deploy this on the production environment, you can use the following command.
# Deployment on production environment
git fetch
git reset --hard origin/main
If --build
option is specified, "giblog build" is executed before publishing.
If --deploy
option is specified, "giblog deploy" is executed after publishing.