aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/hosting-and-deployment
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2019-07-15 23:50:56 +0200
committerBjørn Erik Pedersen <[email protected]>2019-07-15 23:50:56 +0200
commit05d0eddd2bfce4622462428c66c1a9e3abdde614 (patch)
treed5154990025e77a12f4872db494c00f7287d1ebc /docs/content/en/hosting-and-deployment
parentc624a77992c4f7c1bcb5f659e89332d8588986b7 (diff)
parent35febb2e2a3780c3338a2665fddea7dda28a17f4 (diff)
downloadhugo-05d0eddd2bfce4622462428c66c1a9e3abdde614.tar.gz
hugo-05d0eddd2bfce4622462428c66c1a9e3abdde614.zip
Merge commit '35febb2e2a3780c3338a2665fddea7dda28a17f4'
Diffstat (limited to 'docs/content/en/hosting-and-deployment')
-rw-r--r--docs/content/en/hosting-and-deployment/hosting-on-github.md21
-rw-r--r--docs/content/en/hosting-and-deployment/hosting-on-render.md93
2 files changed, 103 insertions, 11 deletions
diff --git a/docs/content/en/hosting-and-deployment/hosting-on-github.md b/docs/content/en/hosting-and-deployment/hosting-on-github.md
index 37b82ab2b..8df6bc87c 100644
--- a/docs/content/en/hosting-and-deployment/hosting-on-github.md
+++ b/docs/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]
@@ -54,15 +54,15 @@ This is a much simpler setup as your Hugo files and generated content are publis
1. Create a `<YOUR-PROJECT>` (e.g. `blog`) repository on GitHub. This repository will contain Hugo's content and other source files.
2. Create a `<USERNAME>.github.io` GitHub repository. This is the repository that will contain the fully rendered version of your Hugo website.
3. `git clone <YOUR-PROJECT-URL> && cd <YOUR-PROJECT>`
-4. Make your website work locally (`hugo server` or `hugo server -t <YOURTHEME>`) and open your browser to <http://localhost:1313>.
+4. Paste your existing Hugo project into a new local `<YOUR-PROJECT>` repository. Make sure your website works locally (`hugo server` or `hugo server -t <YOURTHEME>`) and open your browser to <http://localhost:1313>.
5. Once you are happy with the results:
* Press <kbd>Ctrl</kbd>+<kbd>C</kbd> to kill the server
- * `rm -rf public` to completely remove the `public` directory
-6. `git submodule add -b master [email protected]:<USERNAME>/<USERNAME>.github.io.git public`. This creates a git [submodule][]. Now when you run the `hugo` command to build your site to `public`, the created `public` directory will have a different remote origin (i.e. hosted GitHub repository). You can automate some of these steps with the following script.
+ * Before proceeding run `rm -rf public` to completely remove the `public` directory
+6. `git submodule add -b master [email protected]:<USERNAME>/<USERNAME>.github.io.git public`. This creates a git [submodule][]. Now when you run the `hugo` command to build your site to `public`, the created `public` directory will have a different remote origin (i.e. hosted GitHub repository).
### Put it Into a Script
-You're almost done. You can also add a `deploy.sh` script to automate the preceding steps for you. You can also make it executable with `chmod +x deploy.sh`.
+You're almost done. In order to automate next steps create a `deploy.sh` script. You can also make it executable with `chmod +x deploy.sh`.
The following are the contents of the `deploy.sh` script:
@@ -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
diff --git a/docs/content/en/hosting-and-deployment/hosting-on-render.md b/docs/content/en/hosting-and-deployment/hosting-on-render.md
new file mode 100644
index 000000000..c8fceea7c
--- /dev/null
+++ b/docs/content/en/hosting-and-deployment/hosting-on-render.md
@@ -0,0 +1,93 @@
+---
+title: Host on Render
+linktitle: Host on Render
+description: Host your Hugo site for free with Render's global CDN, fully-managed SSL and auto deploys from GitHub.
+date: 2019-06-06
+publishdate: 2019-06-06
+lastmod: 2019-06-21
+categories: [hosting and deployment]
+keywords: [render,hosting,deployment]
+authors: [Anurag Goel]
+menu:
+ docs:
+ parent: "hosting-and-deployment"
+ weight: 10
+weight: 10
+sections_weight: 10
+draft: false
+aliases: []
+toc: true
+---
+
+## Introduction
+
+[Render](https://render.com) is a fully-managed cloud platform where you can host static sites, backend APIs, databases, cron jobs, and all your other apps in one place.
+
+Static sites are **completely free** on Render and include the following:
+
+- Continuous, automatic builds & deploys from GitHub.
+- Automatic SSL certificates through [Let's Encrypt](https://letsencrypt.org).
+- Instant cache invalidation with a lightning fast, global CDN.
+- Unlimited collaborators.
+- Unlimited [custom domains](https://render.com/docs/custom-domains).
+- Automatic [Brotli compression](https://en.wikipedia.org/wiki/Brotli) for faster sites.
+- Native HTTP/2 support.
+- [Pull Request Previews](https://render.com/docs/pull-request-previews).
+- Automatic HTTP → HTTPS redirects.
+- Custom URL redirects and rewrites.
+
+## Assumptions
+
+* You have an account with GitHub.
+* You have completed the [Quick Start][] or have a Hugo website you are ready to deploy and share with the world.
+* You have a Render account. You can sign up at https://render.com/register.
+
+## Deployment
+
+You can set up a Hugo site on Render in two quick steps:
+
+1. Create a new **Web Service** on Render, and give Render permission to access your GitHub repo.
+2. Use the following values during creation:
+
+ Field | Value
+ ------------------- | -------------------
+ **Environment** | `Static Site`
+ **Build Command** | `hugo --gc --minify` (or our own build command)
+ **Publish Directory** | `public` (or your own output directory)
+
+That's it! Your site will be live on your Render URL (which looks like `yoursite.onrender.com`) as soon as the build is done.
+
+## Continuous Deploys
+
+Now that Render is connected to your repo, it will **automatically build and publish your site** any time you push to GitHub.
+
+You can choose to disable auto deploys under the **Settings** section for your site and deploy it manually from the Render dashboard.
+
+## CDN and Cache Invalidation
+
+Render hosts your site on a global, lightning fast CDN which ensures the fastest possible download times for all your users across the globe.
+
+Every deploy automatically and instantly invalidates the CDN cache, so your users can always access the latest content on your site.
+
+## Custom Domains
+
+Add your own domains to your site easily using Render's [custom domains](https://render.com/docs/custom-domains) guide.
+
+## Pull Request Previews
+
+With Pull Request (PR) previews, you can visualize changes introduced in a pull request instead of simply relying on code reviews.
+
+Once enabled, every PR for your site will automatically generate a new static site based on the code in the PR. It will have its own URL, and it will be deleted automatically when the PR is closed.
+
+Read more about [Pull Request Previews](https://render.com/docs/pull-request-previews) on Render.
+
+## Hugo Themes
+
+Render automatically downloads all Git submodules defined in your Git repo on every build. This way Hugo themes added as submodules work as expected.
+
+## Support
+
+Chat with Render developers at https://render.com/chat or email `[email protected]` if you need help.
+
+
+[Quick Start]: /getting-started/quick-start/