Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for GitLab Pages #1287

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/publishing/ci.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Below we'll describe how to implement each of these strategies using [GitHub Act

## GitHub Actions

[GitHub Actions](https://docs.github.com/en/actions){data-heading="GitHub Actions"} is a Continuous Integration service from GitHub, and an excellent choice if your source code is already managed it a GitHub repository. Quarto makes available a set of [standard](https://github.com/quarto-dev/quarto-actions) GitHub Actions that make it easy to install Quarto and then render and publish content.
[GitHub Actions](https://docs.github.com/en/actions){data-heading="GitHub Actions"} is a Continuous Integration service from GitHub, and an excellent choice if your source code is already managed in a GitHub repository. Quarto makes available a set of [standard](https://github.com/quarto-dev/quarto-actions) GitHub Actions that make it easy to install Quarto and then render and publish content.

Learn about using GitHub Actions with various publishing services here:

Expand All @@ -48,6 +48,12 @@ Learn about using GitHub Actions with various publishing services here:

If you want to use the standard Quarto actions as part of another workflow see the [GitHub Actions for Quarto](https://github.com/quarto-dev/quarto-actions) repository.

## GitLab Pipelines

[GitLab Pipelines](https://docs.gitlab.com/ee/ci/pipelines/){data-heading="GitLab Pipelines"} is a Continuous Integration service from GitLab, and an excellent choice if your source code is already managed in a GitLab repository. Quarto makes available a set of [Docker images](https://github.com/orgs/quarto-dev/packages) that make it easy to use Quarto to render and publish content with GitLab Pipelines.

Learn about using GitLab Pipelines to publish your site with [GitLab Pages](gitlab-pages.qmd).

## Posit Connect

If you are publishing a source code version of your content to Posit Connect it's possible to configure Connect to retrieve the code from a Git repository and then render and execute on the Connect Server.
Expand Down
34 changes: 34 additions & 0 deletions docs/publishing/gitlab-pages.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "GitLab Pages"
---

## Overview

[GitLab Pages](https://pages.github.com/) is a website hosting service that enables you to publish content based on source code managed within a GitLab repository.

There s currently only one way to publish Quarto websites and documents to GitLab Pages:

1. Use a [GitLab Pipeline] to automatically render your files (a single Quarto document or a Quarto project) and publish the resulting content whenever you push a source code change to your repository.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this missing an external link or aim is to reference the section below ?

For the later case, I think we should make the link explicit using an explicit id.

Copy link
Author

@hansfn hansfn Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just using the same trick (?) that is used in github-pages.qmd: A link with no target pointing to an anchor for a heading on the same page.


We'll cover each of these methods below, but first an important pre-requisite: you need to have a Git repository on your local machine that is synced to GitLab. The URL of the published website will be derived from the combination of your username and the repository name (e.g. `https://username.gitlab.io/reponame/`).

You can optionally configure a [custom domain](https://docs.gitlab.com/ee/user/project/pages/custom_domains_ssl_tls_certification/) for a GitLab Pages site, but before exploring that ground you should get your site up and running with the default domain.

### GitLab Pipeline

Before setting up the pipeline, add at least one file that will get rendered and deployed. Enable the pipeline by adding a `.gitlab-ci.yml` file to your repository:

``` {.yaml filename=".gitlab-ci.yml"}
image: ghcr.io/quarto-dev/quarto:latest

pages:
script:
- quarto render --execute --to html --output-dir public
artifacts:
paths:
- public
```

This pipeline will run whenever you push to your repository. It will also run when you manually trigger the pipeline from the **Build - Pipelines** page of your repository.

The pipeline will render your content and publish it to GitLab Pages using the minimal [official Docker image](https://github.com/orgs/quarto-dev/packages) from Quarto. Switch from `ghcr.io/quarto-dev/quarto:latest` to `ghcr.io/quarto-dev/quarto-full:latest` to get programming and LaTeX support.
2 changes: 1 addition & 1 deletion docs/publishing/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ There are a wide variety of ways to publish documents, presentations, and websit

## Getting Started

To get started, review the documentation for using one of the following publishing services:
To get started, review the documentation for using one of the following publishing providers supported by the `quarto publish` command:

{{< include _providers.md >}}
4 changes: 2 additions & 2 deletions docs/publishing/other.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Other Services"

## Overview

There are a wide variety of ways to publish Quarto websites. Other articles cover publishing to [Quarto Pub](quarto-pub.qmd), [GitHub Pages](github-pages.qmd), [Netlify](netlify.qmd), and [Posit Connect](rstudio-connect.qmd). Below we'll describe some general guidelines as well as offer some specific advice for [Firebase](#google-firebase), [Site44], and [Amazon S3]. We'll mostly defer to the documentation provided by the various services, but will note any Quarto website specific configuration required.
There are a wide variety of ways to publish Quarto websites. Other articles cover publishing to [Quarto Pub](quarto-pub.qmd), [GitHub Pages](github-pages.qmd), [GitLab Pages](gitlab-pages.qmd), [Netlify](netlify.qmd), and [Posit Connect](rstudio-connect.qmd). Below we'll describe some general guidelines as well as offer some specific advice for [Firebase](#google-firebase), [Site44], and [Amazon S3]. We'll mostly defer to the documentation provided by the various services, but will note any Quarto website specific configuration required.

The most important thing to understand is that website content is by default written to the `_site` sub-directory and book content to the `_book` directory (you can customize either using the `output-dir` option). Publishing is simply a matter of copying the output directory to a web server or web hosting service.

Expand Down Expand Up @@ -44,4 +44,4 @@ If you are a user of Amazon Web Services you can serve your website directly fro

Any web server or web host can be used to deploy a Quarto website. Here's a recent [CNET roundup](https://www.cnet.com/web-hosting/) of other web hosts you could consider. You can also deploy a Quarto website on any internal (intranet) web server.

You can also render and publish Quarto websites using a Continuous Integration (CI) service. See the articles on [Publishing with CI](ci.qmd) for additional details.
You can also render and publish Quarto websites using a Continuous Integration (CI) service. See the articles on [Publishing with CI](ci.qmd) for additional details.