Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.34 KiB
Newer Older
image: registry.gitlab.tugraz.at/dbp/web-components/toolkit/main:v2
cache:
  key: ${CI_PROJECT_PATH}
  paths:
    - _yarn_cache
    - _playwright_cache

variables:
  PLAYWRIGHT_BROWSERS_PATH: "$CI_PROJECT_DIR/_playwright_cache"
Patrizio Bekerle's avatar
Patrizio Bekerle committed

before_script:
  - yarn config set cache-folder "$CI_PROJECT_DIR/_yarn_cache"
stages:
  - test
  - deploy

test:
  stage: test
  script:
    - yarn install --frozen-lockfile
linting:
  stage: test
  script:
    - yarn install --frozen-lockfile
publish:
  stage: deploy
  environment:
    name: deploy
    url: https://www.npmjs.com/search?q=%40dbp-toolkit
  only:
    refs:
      - master
    # https://www.npmjs.com/settings/dbp-deploy/tokens
    # NPM_TOKEN needs to be a "Publish" token with 2FA disabled!
    # "Automation" tokens don't work with lerna (even if they would work with "npm publish")
    - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc
    - yarn install --frozen-lockfile
    - yarn run build
    - yarn run publish
deploy:
  stage: deploy
  except:
    - schedules
Patrizio Bekerle's avatar
Patrizio Bekerle committed
  only:
    refs:
      - master
      - demo
  inherit:
    variables: false
Patrizio Bekerle's avatar
Patrizio Bekerle committed
  variables:
    UPSTREAM_PROJECT_PATH: ${CI_PROJECT_PATH}
    UPSTREAM_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
    UPSTREAM_COMMIT_SHA: ${CI_COMMIT_SHA}
    project: dbp/deployer