You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your package should now publish to the Package Registry.
85
85
86
-
## Publishing a package via a CI/CD pipeline
86
+
## Publishing a package by using a CI/CD pipeline
87
87
88
-
### Authenticating via the `.npmrc`
89
-
90
-
Create or edit the `.npmrc` file in the same directory as your `package.json` in a GitLab project. Include the following lines in the `.npmrc` file:
88
+
When publishing by using a CI/CD pipeline, you can use the [predefined variables](../../../ci/variables/predefined_variables.md)`${CI_PROJECT_ID}` and `${CI_JOB_TOKEN}` to authenticate with your project's Package Registry. We use these variables to create a `.npmrc` file [for authentication](#authenticating-via-the-npmrc) during execution of your CI/CD job.
- Replace `@scope` with the [root level group](#naming-convention) of the project you're publishing to the package to.
98
-
- The `${CI_PROJECT_ID}` and `${CI_JOB_TOKEN}` are [predefined variables](../../../ci/variables/predefined_variables.md) that are available in the pipeline and do not need to be replaced.
99
-
100
-
### Publishing a package via a CI/CD pipeline
101
-
102
-
In the GitLab project that houses your `.npmrc` and `package.json`, edit or create a `.gitlab-ci.yml` file. For example:
90
+
In the GitLab project containing your `package.json`, edit or create a `.gitlab-ci.yml` file. For example:
0 commit comments