nuxt / nuxt.com

The Nuxt website, made with Nuxt.
https://nuxt.com
MIT License
282 stars 138 forks source link

docs: Add GitLab Pages deploy option #1548

Closed adam-hudak closed 3 months ago

adam-hudak commented 4 months ago

๐Ÿ”— Linked issue

resolves https://github.com/nuxt/nuxt/issues/26599

โ“ Type of change

๐Ÿ“š Description

Add GitLab Pages deploy option

๐Ÿ“ Checklist

atinux commented 4 months ago

By reading https://docs.gitlab.com/ee/user/project/pages/introduction.html#customize-the-default-folder

We can instead tell GitLab to look at the dist/ directory instead @adam-hudak

pages:
  script:
    - npm run generate
  artifacts:
    paths:
      - dist
  publish: dist
adam-hudak commented 4 months ago

Thank you for your comments @alexchopin , @pi0 .

I updated the documentation, remove everything that we don't need and now there is a clean, minimalistic page โค๏ธ

It's beautiful how easy it is to deploy the Nuxt app. Good job guys ๐Ÿ‘

adam-hudak commented 4 months ago

Yes @pi0 , I would like to help. So what you suggest is to write a preset that build an application to /public directory?

atinux commented 4 months ago

@adam-hudak you can take a look at the github pages preset for Nitro: https://github.com/unjs/nitro/blob/main/src/presets/github-pages.ts

adam-hudak commented 4 months ago

@Atinux I also checked other presets in the codebase before, but I think I don't understand what is a function of a preset.

From documentation: Nitro can generate different output formats suitable for different hosting providers from the same code base. Using built-in presets, you can easily configure Nitro to adjust its output format with almost no additional code or configuration!

What output format do I want to achieve? When I look at the differences between presets/github-pages.ts and presents/nitro-dev.ts. I can see that github-pages uses extends: "static", then render 404 page and github specific file .nojekyll. github-pages.ts also define a deploy command, but then in GitHub Pages documentation we define the other deploy job.

For GitLab we also need extends: "static". But I don't understand how it affects Nuxt GitLab Pages deployment process.

Please can you help me understand it better? I am looking for a solution that is not framework specific and would like to know the best approach to achieve this.

Thank you