BumSoft

.sh로 배포 쉽게하기

sh파일로 쉽게 배포하기

c:hugo/hugo_blog/deploy.sh 만들어서 코드로 다음 작성.
screensh

======================deploy.sh========================
#!/bin/bash
echo -e “\033[0;32mDeploying updates to GitHub…\033[0m”
# Build the project.
# hugo -t <여러분의 테마>
hugo -t 테마이름
# Go To Public folder, sub module commit
cd public
# Add changes to git.
git add .
# Commit changes.
msg=“rebuilding site date
if [ $# -eq 1 ]
then msg="$1"
fi
git commit -m “$msg”
# Push source and build repos.
git push origin main
# Come Back up to the Project Root
cd ..
# blog 저장소 Commit & Push
git add .
msg=“rebuilding site date
if [ $# -eq 1 ]
then msg="$1"
fi
git commit -m “$msg”
git push origin main

=======================================================
작성 후 cmd로
실행권한부여 : $ chmod 777 deploy.sh
실행 : $ ./deploy.sh 해주면 알아서 git commit / push해줌!