Skip to content

Commit

Permalink
docs: add Gitlab Pages deployment example
Browse files Browse the repository at this point in the history
Co-authored-by: razonyang <razonyang@gmail.com>
  • Loading branch information
Rubonnek and razonyang committed Aug 28, 2022
1 parent 7c046a2 commit 6cb89c9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
32 changes: 32 additions & 0 deletions exampleSite/content/docs/deployment/gitlab-pages/index.md
@@ -0,0 +1,32 @@
+++
# type = "docs"
title = "Deploy to GitLab Pages"
linkTitle = "GitLab Pages"
date = 2022-08-27T10:30:23+08:00
# description = "" # Used by description meta tag, summary will be used instead if not set or empty.
featured = false
draft = false
comment = true
toc = true
reward = true
pinned = false
carousel = false
categories = ["Deployment"]
tags = ["GitLab Pages", "GitLab CI"]
series = ["Docs"]
images = []
+++

This article explains how to deploy sites to [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/) using GitLab CI.

<!--more-->

## Workflow

Create `.gitlab-ci.yml` at the root of your site with the following contents:

```yaml
{{% code/deployment-gitlab-pages-ci %}}
```

> See also [Starter Template GitLab Pages Configuration](https://github.com/razonyang/hugo-theme-bootstrap-skeleton/blob/main/.gitlab-ci.yml)
1 change: 1 addition & 0 deletions exampleSite/content/docs/deployment/overview/index.md
Expand Up @@ -62,6 +62,7 @@ This step depends on the which deployment methods you use.
1. [GitHub Pages]({{< ref "docs/deployment/github-pages" >}})
1. [Netlify]({{< ref "docs/deployment/netlify" >}})
1. [Cloudflare Pages]({{< ref "docs/deployment/cloudflare-pages" >}})
1. [GitLab Pages]({{< ref "docs/deployment/gitlab-pages" >}})
1. Find more on [Hosting & Deployment](https://gohugo.io/hosting-and-deployment/)

## Further Reading
Expand Down
@@ -0,0 +1,21 @@
image: registry.gitlab.com/pages/hugo/hugo_extended:latest

variables:
HUGO_ENV: production

default:
before_script:
- apk add --update --no-cache git go npm
- npm install
- hugo mod get -u

test:
script:
- hugo --gc --minify

pages:
script:
- hugo --gc --minify
artifacts:
paths:
- public

0 comments on commit 6cb89c9

Please sign in to comment.