Start a new Pages website from scratch or deploy an existing website
If you already have a website and want to deploy it with GitLab Pages, or, if you want to start a new site from scratch, you’ll need to:
- Create a new project in GitLab to hold your site content.
- Set up GitLab CI/CD to deploy your website to Pages.
To do so, follow the steps below.
- From your Project’s Dashboard, click New project, and name it according to the Pages domain names.
- Clone it to your local computer, add your website
files to your project, add, commit, and push to GitLab.
Alternatively, you can run
git init
in your local directory, add the remote URL:git remote add origin git@gitlab.com:namespace/project-name.git
, then add, commit, and push to GitLab. -
From the your Project’s page, click Set up CI/CD:
-
Choose one of the templates from the dropbox menu. Pick up the template corresponding to the SSG you’re using (or plain HTML).
Note that, if you don’t find a corresponding template, you can look into GitLab Pages group of sample projects, you may find one among them that suits your needs, from which you can copy
.gitlab-ci.yml
’s content and adjust for your case. If you don’t find it there either, learn how to write a.gitlab-ci.yml
file for GitLab Pages.
Once you have both site files and .gitlab-ci.yml
in your project’s
root, GitLab CI/CD will build your site and deploy it with Pages.
Once the first build passes, you access your site by
navigating to your Project’s Settings > Pages,
where you’ll find its default URL. It can take approximately 30 min to be
deployed.
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc