I have the following error with Gitlab pages > Unable to locate config file or config directory. Perhaps you need to create a new site.
I have everything installed, my site is ready to publish, my config file is ok, my .yml too, and can’t pass the pipeline on stage pages.
I should probably mention that my Gitlab repository contains 2 folders, one folder of a project, and the second is the actual Hugo static site with documentation about the project. My .yml it’s in the root of the repository.
Any idea?
We cannot know what’s going on without seeing the source code of the project in question as described in the forum guidelines for Requesting Help
Also we discourage bumping old topics as members who participated in those discussions may no longer be active, therefore I moved your post into its own topic because the other one was from a year ago.
Thank you for your reply.
This is my .girlab-ci.yml file
build-job:
stage: build
script:
- echo "Hello, $GITLAB_USER_LOGIN!"
test-job1:
stage: test
script:
- echo "This job tests something"
test-job2:
stage: test
script:
- echo "This job tests something, but takes more time than test-job1."
- echo "After the echo commands complete, it runs the sleep command for 20 seconds"
- echo "which simulates a test that runs 20 seconds longer than test-job1"
- sleep 20
image: registry.gitlab.com/pages/hugo/hugo_extended:0.76.5
variables:
GIT_SUBMODULE_STRATEGY: recursive
test:
script:
- hugo
except:
- master
pages:
script:
- hugo
artifacts:
paths:
- public
only:
- master
deploy-prod:
stage: deploy
script:
- echo "This job deploys something from the $CI_COMMIT_BRANCH branch."
And a screenshot of the structure of my files inside the Hugo folder:
I am aware that in the folder it is another .gitlab-ci.yml file but that one shouldn’t be a problem.
No longer using GitLab myself, so hopefully someone else will look into the above.
But shouldn’t you invoke hugo
to build your project, in the build-job.script
param ?
Just asking…
Also the contents of your project’s config.toml
need to be seen.
But shouldn’t you invoke
hugo
to build your project, in thebuild-job.script
param ?
I am not sure. I was following Gitlab pages exampe for setting up .girlab-ci.yml
file for Hugo
Also the contents of your project’s
config.toml
need to be seen.
config.toml
# Change to your website's URL (NO trailing slash)
#For local dev, change to: http://localhost:1313
baseURL = "https://name.gitlab.io/documentation/"
#baseURL = "/"
#relativeURLs = true
# Change to your Brand or Website Title
title = "Documentation"
author = "test"
# Language codes (lowercase)
languageCode = "en-us"
defaultContentLanguage = "en"
# Which theme to use
theme = "axiom"
# Pagination (increase number for production)
paginate = 2
# Canonify relative URLs using baseURL
canonifyURLs = false
# Length of snippet on post index and structured data
summaryLength = 40
# Max posts to show in atom feed
rssLimit = 100
# Enable Emoji's in posts
enableEmoji = true
# Output a robots.txt file (see the 'Frontmatter' Docs page)
enableRobotsTXT = false
# Don't automatically mangle titles
pluralizelisttitles = true
extensions = ["hardLineBreak"]
Sorry, but how is a screenshot of that helpful? Colourful graphs is what you show your “boss”, but not us I am 100% sure Gitlab offers some kind of log for the failed test. Click it and see what happens.
I too don’t use Gitlab (it doesn’t like me), but from Github I know, that in “workflows” (which is their CI feature) you have to check out the repository before you do anything. Your .girlab-ci.yml
(r? t?) does not show anything that I would interpret as “clone the repo recursively”. So maybe the file is not found because it’s not there. The test-jobs are just echoing some sentiments. Let’s hope a Gitlab expert drives by soon, maybe add “(Gitlab)” to your subject.
Step 1: Make your repo publicly available so we don’t need to ask for every bit of info successively
Step 2: Get the logfile of the failed testing run, click the cogwheel in the icon-bar of the editor of this forum when you hit “reply” and add EVERYTHING in the log in a readable way.
Ok. I found the solution.
My .gitlab-ci.yml
file was off.
This is how it looks now:
stages:
- build
- test
- publish
- deploy
build-job:
stage: build
script:
- echo "Hello, $GITLAB_USER_LOGIN!"
test-job1:
stage: test
script:
- echo "This job tests something"
test-job2:
stage: test
script:
- echo "This job tests something, but takes more time than test-job1."
- echo "After the echo commands complete, it runs the sleep command for 20 seconds"
- echo "which simulates a test that runs 20 seconds longer than test-job1"
- sleep 20
variables:
GIT_SUBMODULE_STRATEGY: recursive
pages:
stage: publish
image: registry.gitlab.com/pages/hugo/hugo_extended:0.76.5
cache: {}
script:
- hugo -s documentation # Render the Hugo site
- mv documentation/public . # Move the public folder into place
artifacts:
paths:
- public # Tell GitLab Pages to serve the public folder
only:
- master
deploy-prod:
stage: deploy
script:
- echo "This job deploys something from the $CI_COMMIT_BRANCH branch."
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.