Hugo automatically deploy makefile

Posted by JamsBlocKK Blog on Friday, January 11, 2019

hugo website 要發佈到github 總是很麻煩

來使用 makefile 簡易寫一個scipt的發佈 makefile 檔案 記得放在 website-hugo 的第一層

之後開始寫 blog 只要輕鬆的 make deploy 就可以快速發佈了

makefile 範例檔:

    GITHUB_NAME = jamesblockk

    deploy :
        rm -rf public
        git clone https://github.com/$(GITHUB_NAME)/$(GITHUB_NAME).github.io.git
        mv $(GITHUB_NAME).github.io public
        hugo
        cd public/ && git add . 
        cd public/ && git commit -m "[ToDo] update" 
        cd public/ && git push 

附上github 檔案位置 https://github.com/jamesblockk/quick/blob/master/hugo/makefile