-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Unable to deploy my gatsby(node) blog to Gitlab #13924
Comments
@AbhimanyuAryan ok, skimming though the issue description, looks like something probably is not added in the gitlab configuration file, namely #require latest node
image: node:latest
stages:
- deploy
# add cache to node_modules for speed
cache:
paths:
- node_modules/ #node modules and dependencies
#- .cache/
# the 'pages' job will deploy and build your site to the 'public' path
pages:
stage: deploy
script:
- apt-get update -qy
- apt-get install -y build-essential
- npm install
- npm run build # build the site
artifacts:
paths:
- public
only:
- master Key thing here, the installation of the development package suit "scripts": {
"build": "gatsby build --prefix-paths",
"develop": "gatsby develop",
"start": "npm run develop",
"format": "prettier --write \"src/**/*.js\"",
"test": "echo \"Error: no test specified\" && exit 1"
}, Feel free to provide feedback so that we can close this issue, or continue to work on it till we do find a solution. |
@jonniebigodes I got this error. After adding "scripts" to package.json and modifying .gitlab-ci.yml
|
@AbhimanyuAryan i've just finished a couple of tests with the starter blog, the first one was done after bumping the packages used and commiting them to gitlab, checked the CI/CD and it ran without issues. After that i cleaned the cache and retried the deployment and apart of one error, that being that the cache was not present, once again it ran without any issues. I'll leave the repo used here so that you go over it and compare it to yours. |
@AbhimanyuAryan You're using
Please update |
@sidharthachatterjee how can I mention older image of Node which works fine. All I want to do is change gitlab.yml file. I don't want to upgrade to the latest stuff. I have been facing problems with Gatsby for the past 6 months. Every time I deploy there's something outdated just tell me...which version will work: https://hub.docker.com/_/node?tab=description and i'll change to that docker image |
@AbhimanyuAryan alternatively you can try: image: node:10 to get a node 10 image. Or like the repo i posted the packages are bumped to the almost final versions or go with @sidharthachatterjee option. |
I have gatsby blog that I'm trying to host on Gitlab but I get deployment error. I tried adding
rm -R /public /node_modules
under script section in.gitlab-ci.yml
but it didn't workMy .gitlab-ci.yml file
When I commit my code to Gitlab. It doens't deploy my blog. I get the below error. Earlier it was working though
The text was updated successfully, but these errors were encountered: