Skip to content
Snippets Groups Projects
Select Git revision
  • 8287f75d189865d01b6b86a3cf82291b11dd6230
  • main default protected
  • popup-style
  • keyboard-bindings
  • compress-scripts
  • ci
  • input-poc
  • 0.2.2
  • 0.2.1
  • 0.2.0
  • test-0.1.0
11 results

.gitlab-ci.yml

Blame
  • .gitlab-ci.yml 2.15 KiB
    image: node:16-alpine
    stages:
      - test
      - build
      - deploy
      - release
    
    # Prevent detached merge request pipelines
    # https://docs.gitlab.com/ee/ci/merge_request_pipelines/
    # Those do not run the environment on_stop jobs when MRs are closed/merged
    # or when branches get deleted, unlike branch pipelines.
    workflow:
      rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: never
        - when: always
    
    before_script:
      - npm ci
    
    lint:
      stage: test
      script:
        - npm run lint
    
    audit:
      stage: test
      script:
        - npm audit --parseable
      allow_failure: true
    
    build-webext:
      stage: build
    
      # Ignore frontend-audit to speed up CI builds
      needs:
        - lint
      artifacts:
        paths:
          - dist-ext
        expire_in: 2 weeks
      script:
        - npm run build-ext
    
    build-lib:
      stage: build
    
      # Ignore frontend-audit to speed up CI builds
      needs:
        - lint
      artifacts:
        paths:
          - dist-lib
        expire_in: 2 weeks
      script:
        - npm run build-lib
    
      # Only deploy branches on surge
      rules:
        - if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != "master"'
          when: on_success
        - when: never
    
    .surge:
      stage: deploy
    
      environment:
        name: ${CI_COMMIT_REF_SLUG}
    
      before_script: