Multiple build and deploy with different configurations

Hi,

I’m having trouble building and deploying 2 different builds.
I have one build for a Browser-App and one for a Mobile App, and want to deploy them on different Servers.

The Artifacts are looking fine, but only the “build web” gets deployed to both locations.

Any Ideas?

My CI looks like this:

stages:
- buildWeb
- deployWeb
- buildApp
- deployApp

build web:
  image: node:8
  stage: buildWeb
  script:
  - npm install --progress=false
  - cp src/config.js.dist src/config.js
  - npm run build
  artifacts:
    name: web
    expire_in: 1 week
    paths:
    - dist

deploy web:
  image: alpine
  stage: deployWeb
  script:
  - apk add --no-cache rsync openssh
  - mkdir -p ~/.ssh
  - echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
  - chmod 600 ~/.ssh/id_dsa
  - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  - rsync -rlpgovDO --delete dist/ gitlab@deploy.web:/var/www/app/pwa
  environment:
    name: production
    url: https://www.example.de
  only:
  - master

build app:
  image: node:8
  stage: buildApp
  script:
  - rm -rf dist/
  - npm install --progress=false
  - cp src/config.js.dist src/config.js
  - sed -i -- 's/web/app/g' src/config.js
  - npm run build
  artifacts:
    name: app
    expire_in: 1 week
    paths:
    - dist

deploy app:
  image: alpine
  stage: deployApp
  script:
  - apk add --no-cache rsync openssh
  - mkdir -p ~/.ssh
  - echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
  - chmod 600 ~/.ssh/id_dsa
  - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  - rsync -rlpgovDO --delete dist/ gitlab@deploy.app:/var/www/app/app
  environment:
    name: app
    url: https://app.example.de
  only:
  - master

# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
  paths:
  - node_modules/

Thanks a lot.

Chris