Solved: This GitLab CI configuration is invalid: root config contains unknown keys: artifacts

In this article, We are going to discuss about the error “the invalid: root config contains unknown keys: artifacts” came while saving the .gitlab-ci.yml file, and moreover why this or such error came and how we can fix this or related error.
while you are getting this error “This GitLab CI configuration is invalid: root config contains unknown keys: artifacts” it’s mean that you are new in GitLab and trying to explore the thing.
{Read:- 5 Ways to Improve SEO on Your WordPress Site }
This article help you to give a good understanding about such error and how to fix these type of error.
Below is sample code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
image: node:latest cache: paths: - node_modules/ artifacts: paths: - dist/ stages: - build build: stage: build script: - npm install --------------- To --------------------------- image: node:latest cache: paths: - node_modules/ stages: - build build: stage: build script: - npm install - npm -v artifacts: paths: - dist/ |
Move artifacts inside Build to fix this error.
artifacts :
- Introduced in GitLab Runner v0.7.0 for non-Windows platforms.
- Windows support was added in GitLab Runner v.1.0.0.
- From GitLab 9.2, caches are restored before artifacts.
- Not all executors are supported.
- Job artifacts are only collected for successful jobs by default.
artifacts is used to specify a list of files and directories which should be attached to the job when it succeeds, fails, or always.
The artifacts will be sent to GitLab after the job finishes and will be available for download in the GitLab UI.
{Read:- How to Build a WordPress Site in 1 Day }
If this is problematic, administrators installing GitLab can disable the bundled NGINX service, but this puts the burden on them to keep the NGINX configuration in tune with GitLab during application updates. Bundled services in Omnibus GitLab (GitLab itself, NGINX, Postgres, Redis, Mattermost) are isolated from each other using Unix user accounts. Creating and managing these user accounts requires root access. By default, Omnibus GitLab will create the required Unix accounts during