debian-mirror-gitlab/doc/user/project/pages/getting_started/pages_ui.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

77 lines
3.4 KiB
Markdown
Raw Normal View History

2022-10-11 01:57:18 +05:30
---
stage: Create
group: Incubation
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2022-10-11 01:57:18 +05:30
---
2023-03-04 22:38:38 +05:30
# Create a Pages deployment for your static site **(FREE)**
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
If you already have a GitLab project that contains your static site or framework,
you can generate a GitLab Pages website from it.
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
When you provide basic information in the UI, a `.gitlab-ci.yml` file is created
and a merge request opened. When you commit the merge request,
a pipeline deploys your Pages website.
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
## Prerequisites
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
- Your app must [output files to the `public` folder](../public_folder.md). If you create
this folder during the build pipeline, you do not need to commit it to Git.
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
WARNING:
This step is important. Ensure your files are in a root-level `public` folder.
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
- You must have a project that either:
- Generates static sites or a client-rendered single-page application (SPA),
like [Eleventy](https://www.11ty.dev), [Astro](https://astro.build), or [Jekyll](https://jekyllrb.com).
- Contains a framework configured for static output, such as [Next.js](https://nextjs.org),
[Nuxt.js](https://nuxtjs.org), or [SvelteKit](https://kit.svelte.dev).
- GitLab Pages must be enabled for the project. (To enable, go to **Settings > General**,
expand **Visibility, project features, permissions**, and turn on the **Pages** toggle.)
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
## Create the Pages deployment
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
To complete the setup and generate a GitLab Pages deployment:
2022-10-11 01:57:18 +05:30
1. On the top bar, select **Main menu > Projects** and find your project.
2023-04-23 21:23:45 +05:30
1. On the left sidebar, select **Settings > Pages**.
If this path is not visible, select **Deployments > Pages**.
[This location is part of an experiment](../index.md#menu-position-test).
2023-03-17 16:20:25 +05:30
A **Get Started with Pages** form appears. If this form is not available,
see [Troubleshooting](#if-the-get-started-with-pages-form-is-not-available).
2023-03-04 22:38:38 +05:30
1. For **Step 1**, enter an image name and verify that your files are in a `public` folder.
1. Select **Next**.
1. For **Step 2**, enter your installation steps. If your framework's build process does not
need one of the provided build commands, you can either:
2022-10-11 01:57:18 +05:30
- Skip the step by selecting **Next**.
- Enter `:` (the bash "do nothing" command) if you still want to incorporate that
step's boilerplate into your `.gitlab-ci.yml` file.
2023-03-04 22:38:38 +05:30
1. Select **Next**.
1. For **Step 3**, enter scripts that indicate how to build your application.
1. Select **Next**.
1. Optional. Edit the generated `.gitlab-ci.yml` file as needed.
1. For **Step 4**, add a commit message and select **Commit**. This commit triggers your first
2022-10-11 01:57:18 +05:30
GitLab Pages deployment.
2023-03-04 22:38:38 +05:30
To view the running pipeline, go to **CI/CD > Pipelines**.
To view the artifacts that were created during the deployment, view the job,
and on the right side, select **Download artifacts**.
2023-01-13 00:05:48 +05:30
2022-10-11 01:57:18 +05:30
## Troubleshooting
2023-03-04 22:38:38 +05:30
### If the `Get Started with Pages` form is not available
2022-10-11 01:57:18 +05:30
2023-04-23 21:23:45 +05:30
The `Get Started with Pages` form is not available if you:
2022-10-11 01:57:18 +05:30
- Deployed a GitLab Pages site before.
2023-04-23 21:23:45 +05:30
- Committed `.gitlab-ci.yml` through the forms at least one time.
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
To fix this issue:
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
- If the message **Waiting for the Pages Pipeline to complete** appears, select
**Start over** to start the form again.
2022-10-11 01:57:18 +05:30
- If your project has previously deployed GitLab Pages successfully,
2023-03-04 22:38:38 +05:30
[manually update](pages_from_scratch.md) your `.gitlab-ci.yml` file.