diff options
Diffstat (limited to 'docs/content/en/hosting-and-deployment')
3 files changed, 94 insertions, 4 deletions
diff --git a/docs/content/en/hosting-and-deployment/hosting-on-21yunbox.md b/docs/content/en/hosting-and-deployment/hosting-on-21yunbox.md new file mode 100644 index 000000000..b0ea7a7cf --- /dev/null +++ b/docs/content/en/hosting-and-deployment/hosting-on-21yunbox.md @@ -0,0 +1,65 @@ +--- +title: Host on 21YunBox +linktitle: Host on 21YunBox +description: Host your Hugo site with 21YunBox's blazing fast Chinese CDN, fully-managed SSL and auto deploys from Gitee. +date: 2021-01-06 +publishdate: 2021-01-06 +lastmod: 2021-01-06 +categories: [hosting and deployment] +keywords: [21yunbox,hosting,deployment] +authors: [Toby Glei] +menu: + docs: + parent: "hosting-and-deployment" + weight: 10 +weight: 10 +sections_weight: 10 +draft: false +aliases: [] +toc: true +--- + +[21YunBox](https://www.21yunbox.com) is a fully-managed cloud platform dedicated to make web deployment easy within the Chinese Great Firewall where you can host static sites, backend APIs, databases, cron jobs, and all your other apps in one place. It provides blazing fast Chinese CDN, continuous deployment, one-click HTTPS and [other services like managed databases and backend web services](https://www.21yunbox.com/docs/), providing an avenue to launch web projects in China. + +21YunBox includes the following features: + +- Continuous, automatic builds & deploys from GitHub and Gitee +- Automatic SSL certificates through [Let's Encrypt](https://letsencrypt.org) +- Instant cache invalidation with a blazing fast, Chinese CDN +- Unlimited [custom domains](https://www.21yunbox.com/docs/#/custom-domains) +- Automatic [Brotli compression](https://en.wikipedia.org/wiki/Brotli) for faster sites +- Native HTTP/2 support +- Automatic HTTP → HTTPS redirects +- Custom URL redirects and rewrites + +## Prerequisites + +This guide assumes you already have a Hugo project to deploy. If you need a project, use the [Quick Start](/getting-started/quick-start/) to get started or fork 21YunBox's [Hugo Example](https://gitee.com/eryiyunbox-examples/hello-hugo) before continuing. + +## Setup + +You can set up a Hugo site on 21YunBox in two quick steps: + +1. Create a new web service on 21YunBox, and give 21YunBox permission to access your GitHub or Gitee repo. +2. Use the following values during creation: + + | Field | Value | + | --------------------- | ------------------------------------------------ | + | **Environment** | `Static Site` | + | **Build Command** | `hugo --gc --minify` (or your own build command) | + | **Publish Directory** | `./public` (or your own output directory) | + +That's it! Your site will be live on your 21YunBox URL (which looks like `yoursite.21yunbox.com`) as soon as the build is done. + +## Continuous deploys + +Now that 21YunBox is connected to your repo, it will automatically build and publish your site any time you push to GitHub. + +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 21YunBox's [custom domains](https://www.21yunbox.com/docs/#/custom-domains) guide. + +## Support +Click [here](https://www.21yunbox.com/docs/#/contact) to contact with 21YunBox' experts if you need help. diff --git a/docs/content/en/hosting-and-deployment/hosting-on-azure-static-web-apps.md b/docs/content/en/hosting-and-deployment/hosting-on-azure-static-web-apps.md new file mode 100644 index 000000000..9d9daa578 --- /dev/null +++ b/docs/content/en/hosting-and-deployment/hosting-on-azure-static-web-apps.md @@ -0,0 +1,23 @@ +--- +title: Hosting on Azure Static Web Apps +linktitle: Hosting on Azure Static Web Apps +description: Learn how to deploy a Hugo application to Azure Static Web Apps. +date: 2022-05-09 +publishdate: 2022-05-09 +categories: [hosting and deployment] +keywords: [hosting,Azure Static Web Apps] +authors: [Azure Static Web Apps] +menu: + docs: + parent: "hosting-and-deployment" + weight: 200 +weight: 200 +sections_weight: 200 +draft: false +toc: true +aliases: [] +--- + +You can create and deploy a Hugo web application to Azure Static Web Apps. The final result is a new Azure Static Web App with associated GitHub Actions that give you control over how the app is built and published. You'll learn how to create a Hugo app, setup an Azure Static Web App and deploy the Hugo app to Azure. + +Here's the tutorial on how to [Publish a Hugo site to Azure Static Web Apps](https://docs.microsoft.com/en-us/azure/static-web-apps/publish-hugo). 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 ae30ce44a..22acca568 100644 --- a/docs/content/en/hosting-and-deployment/hosting-on-github.md +++ b/docs/content/en/hosting-and-deployment/hosting-on-github.md @@ -47,7 +47,7 @@ As mentioned in the [GitHub Pages documentation][ghorgs], you can host a user/or ## Build Hugo With GitHub Action -GitHub executes your software development workflows. Everytime you push your code on the Github repository, Github Actions will build the site automatically. +GitHub executes your software development workflows. Everytime you push your code on the GitHub repository, Github Actions will build the site automatically. Create a file in `.github/workflows/gh-pages.yml` containing the following content (based on [actions-hugo](https://github.com/marketplace/actions/hugo-setup)): @@ -62,9 +62,9 @@ on: jobs: deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod @@ -88,10 +88,12 @@ jobs: For more advanced settings [actions-hugo](https://github.com/marketplace/actions/hugo-setup) and [actions-gh-pages](https://github.com/marketplace/actions/github-pages-action). -## Github pages setting +## GitHub pages setting + By default, the GitHub action pushes the generated content to the `gh-pages` branch. This means GitHub has to serve your `gh-pages` branch as a GitHub Pages branch. You can change this setting by going to Settings > GitHub Pages, and change the source branch to `gh-pages`. ## Change baseURL in config.toml + Don't forget to rename your `baseURL` in `config.toml` with the value `https://<USERNAME>.github.io` for your user repository or `https://<USERNAME>.github.io/<REPOSITORY_NAME>` for a project repository. Unless this is present in your `config.toml`, your website won't work. |