1

I created an Angular Library as described here: https://angular.io/guide/creating-libraries. I have already uploaded the source code to Gitlab The library is created using ng build --prod which creates a dist/ folder containing the bundled files. I do not want to publish the lib to npm. I want to use a GitLab repo instead, so that I can install the lib in other Angular Projects with

npm install git+ssh://git@gitlab.example.com:project/example.git

I want to create a Gitlab CI for this. It should execute ng build --prod and then commit the build files to a different repository. Does anyone know how to configure the .gitlab-ci.yml to achieve this? Thanks a lot!

Edit: I have already figured out how to create the Angular Build Artifacts:

build:
 stage: build
 image: trion/ng-cli
 before_script:
  - npm ci
 script:
  - ng build --prod
 artifacts:
  expire_in: 1 day
  paths:
   - dist/
 tags:
  - docker

The thing missing now is committing them to a repository.

Tom
  • 1,358
  • 2
  • 14
  • 36

0 Answers0