Giblog::Command::publish - Website publish command
Giblog::Command::publish is website publish command.
giblog publish REMOTE_REPOSITORY BRANCH
giblog publish --build REMOTE_REPOSITORY BRANCH
Giblog::Command::publish inherits all methods from Giblog::Command and implements the following new ones.
$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 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.
To install Giblog, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.