Commit 1f5f39fd authored by Claudio W's avatar Claudio W 📖
Browse files

feat(ci): refactored the whole gitlab pipeline

parent 59e349ac
image: node:15-slim
cache: &cacheSettings
key:
files:
- documentation/Gemfile.lock
- package-lock.json
when: on_success
policy: pull
paths:
- documentation/.bundler-cache/
- .npm
.npmInstallScript: &npmInstallScript
- npm ci --no-shrinkwrap --cache .npm --prefer-offline
.rubyInstallScript: &rubyInstallScript
- gem install bundler
- bundle install -j $(nproc) --gemfile documentation/Gemfile --path documentation/.bundler-cache --deployment --frozen
stages:
- build:ui
- build:docs
- install
- build
- deploy
install:node:
stage: install
needs: [ ]
script:
- *npmInstallScript
cache:
<<: *cacheSettings
policy: pull-push
install:ruby:
stage: install
needs: [ ]
image: ruby:2.7
script:
- *rubyInstallScript
cache:
<<: *cacheSettings
policy: pull-push
build:ui:
stage: build:ui
build:library:
stage: build
needs:
- job: install:node
script:
- npm ci
- *npmInstallScript
- npm run build
artifacts:
paths:
- dist
- assets
expire_in: 1 day
pages:
image: ruby:2.7
stage: build:docs
build:jekyll:
stage: build
needs:
- job: install:ruby
- job: build:library
artifacts: true
script:
- mkdir public documentation/_sass/custom
- cd documentation && gem install bundler
- bundle install
- *rubyInstallScript
- cd documentation
- mkdir _sass/custom
- cp ../dist/index.css "_sass/custom/custom.scss"
- bundle exec jekyll build -d ../public
- bundle exec jekyll build -d build
artifacts:
paths:
- documentation/build
expire_in: 1 day
pages:
stage: deploy
needs:
- job: build:jekyll
artifacts: true
script:
- *rubyInstallScript
- rm -rf public
- mv documentation/build public
artifacts:
paths:
- public
expire_in: 1 day
only:
- main
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment