Deploy
GitLab Pages
Deploy your Nuxt Application to GitLab Pages.
Nuxt supports deploying on the GitLab Pages with minimal configuration.
GitLab Pages only support static sites, Nuxt will pre-render your application to static HTML files.
Deployment
- Here is an example GitLab Pages workflow to deploy your site to GitLab Pages:
.gitlab-ci.yml
# The Docker image that will be used to build your app
image: node:lts
# Functions that should be executed before the build script is run
before_script:
- npm install
cache:
paths:
# Directories that are cached between builds
- node_modules/
pages:
script:
# Specify the steps involved to build your app here
- npm run generate
artifacts:
paths:
# The directory that contains the built files to be published
- .output/public
# The directory that contains the built files to be published
publish: .output/public
rules:
# This ensures that only pushes to the default branch
# will trigger a pages deploy
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH