kind: pipeline
name: build
type: docker

platform:
  os: linux
  arch: amd64

steps:
  - name: build-master
    image: plugins/docker
    when:
      branch:
        - master
    environment:
      REACT_APP_PUBLIC_PATH: https://map.vault48.org/
      REACT_APP_API_ADDR: https://backend.map.vault48.org
      REACT_APP_OSRM_URL: https://vault48.org:5001/route/v1
      REACT_APP_OSRM_PROFILE: bike
    settings:
      dockerfile: docker/www/Dockerfile
      build_args_from_env:
        - REACT_APP_PUBLIC_PATH
        - REACT_APP_API_ADDR
        - REACT_APP_OSRM_URL
        - REACT_APP_OSRM_PROFILE
      tag:
        - ${DRONE_BRANCH}
      username:
        from_secret: global_docker_login
      password:
        from_secret: global_docker_password
      registry:
        from_secret: global_docker_registry
      repo:
        from_secret: docker_repo