From ab2233c3956c2327022c8d0f080062d2b0dbacac Mon Sep 17 00:00:00 2001 From: AdaKaleh <31895292+adakaleh@users.noreply.github.com> Date: Thu, 13 Jun 2019 15:40:26 +0000 Subject: [PATCH] Update publish_to_ghpages.sh * Fix publish_to_ghpages.sh * Add "git push" comment to the end of publish_to_ghpages.sh * Remove redundant suggestion about CNAME file --- .../en/hosting-and-deployment/hosting-on-github.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/content/en/hosting-and-deployment/hosting-on-github.md b/content/en/hosting-and-deployment/hosting-on-github.md index 37b82ab2b..6ce5acfbe 100644 --- a/content/en/hosting-and-deployment/hosting-on-github.md +++ b/content/en/hosting-and-deployment/hosting-on-github.md @@ -4,7 +4,7 @@ linktitle: Host on GitHub description: Deploy Hugo as a GitHub Pages project or personal/organizational site and automate the whole process with a simple shell script. date: 2014-03-21 publishdate: 2014-03-21 -lastmod: 2017-03-30 +lastmod: 2018-09-22 categories: [hosting and deployment] keywords: [github,git,deployment,hosting] authors: [Spencer Lyon, Gunnar Morling] @@ -193,11 +193,7 @@ To automate these steps, you can create a script with the following contents: {{< code file="publish_to_ghpages.sh" >}} #!/bin/sh -DIR=$(dirname "$0") - -cd $DIR/.. - -if [[ $(git status -s) ]] +if [ "`git status -s`" ] then echo "The working directory is dirty. Please commit any pending changes." exit 1; @@ -220,9 +216,12 @@ hugo echo "Updating gh-pages branch" cd public && git add --all && git commit -m "Publishing to gh-pages (publish.sh)" + +#echo "Pushing to github" +#git push --all {{< /code >}} -This will abort if there are pending changes in the working directory and also makes sure that all previously existing output files are removed. Adjust the script to taste, e.g. to include the final push to the remote repository if you don't need to take a look at the gh-pages branch before pushing. Or adding `echo yourdomainname.com >> CNAME` if you set up for your gh-pages to use customize domain. +This will abort if there are pending changes in the working directory and also makes sure that all previously existing output files are removed. Adjust the script to taste, e.g. to include the final push to the remote repository if you don't need to take a look at the gh-pages branch before pushing. ### Deployment of Project Pages from Your `master` Branch