image: gabrielaraujof/angular-cli

stages:
  - build
  - unit test
  - deploy staging
  - e2e test
  - deploy prod

before_script:
  - npm install

cache:
  paths:
  - node_modules/

bundling job:
  stage: build
  script:
  - ng build --prod

unit testing job:
  stage: unit test
  script:
  - ng test --watch=false

deploy staging:
  stage: deploy staging
  script:
  - firebase deploy -m "Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --token=$FIREBASE_TOKEN --project pypicompare --non-interactive
  environment:
    name: staging
    url: https://pypicompare.firebaseapp.com
  only:
  - master

e2e testing job:
  stage: e2e test
  script:
  - ng e2e
  only:
  - master

pages:
  stage: deploy prod
  script:
  - ng build --prod --bh /pypicompare/
  - mkdir public && mv dist/* public/.
  artifacts:
    paths:
    - public
  environment:
    name: production
    url: https://gabrielaraujof.gitlab.io/pypicompare/
  only:
  - master
  when: manual

image: gabrielaraujof/angular-cli

stages:
  - build
  - unit test
  - deploy staging
  - e2e test
  - deploy prod

before_script:
  - npm install

cache:
  paths:
  - node_modules/

bundling job:
  stage: build
  script:
  - ng build --prod
  artifacts:
    paths:
    - dist/

unit testing job:
  stage: unit test
  script:
  - ng test --watch=false

deploy staging:
  stage: deploy staging
  script:
  - firebase deploy -m "Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --token=$FIREBASE_TOKEN --project pypicompare --non-interactive
  environment:
    name: staging
    url: https://pypicompare.firebaseapp.com
  dependencies:
  - bundling job
  only:
  - master

e2e testing job:
  stage: e2e test
  script:
  - ng e2e
  only:
  - master

pages:
  stage: deploy prod
  script:
  - ng build --prod --bh /pypicompare/
  - mkdir public && mv dist/* public/.
  artifacts:
    paths:
    - public
  environment:
    name: production
    url: https://gabrielaraujof.gitlab.io/pypicompare/
  only:
  - master
  when: manual

Add artifacts and dependencies to the pipeline config
Add artifacts and dependencies to the pipeline config
