vuejs-templates / webpack

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
MIT License
9.7k stars 4.38k forks source link

Deploy to Gitlab Pages using Gitlab CI #1476

Closed superlulu closed 5 years ago

superlulu commented 5 years ago

Hello Folks,

I'm trying to deploy my vue/webpack-App to Gitlab pages following this quick tutorial: Deploy Vue CLI to Gitlab Pages

there it says the .gitlab-ci-yml file should contain following Code:

pages: # the job must be named pages
  image: node:latest
  stage: deploy
  script:
    - npm ci
    - npm run build
    - mv public public-vue # GitLab Pages hooks on the public folder
    - mv dist public # rename the dist folder (result of npm run build)
  artifacts:
    paths:
      - public # artifact path must be /public for GitLab Pages to pick it up
  only:
    - master

But the Job Pipeline Fails due to the fact that there is no public folder in this template to move.

$ mv public public-vue
mv: cannot stat 'public': No such file or directory
ERROR: Job failed: exit code 1

Has anyone a suggestion on how to get the .gitlab-ci.yml file to work for the webpack template?

superlulu commented 5 years ago

Wow, that was simple. removing - mv public public-vue from the script since there is no public folder does the trick. Closing this.

shamimsdp commented 5 years ago

@superlulu I think you need to create public folder first. - npm run build - mkdir .public - mv .public public-vue # GitLab Pages hooks on the public folder