#  Template NodeJS build

#  This template allows you to validate your NodeJS code.
#  The workflow allows running tests and code linting on the default branch.

image: node:18

pipelines:
  branches:
    main:
      - step:
          name: BAMS::PROD
          services:
            - docker
          caches:
            - node
          script:
            - npm install
            - npm run build-prod
            - pipe: atlassian/ftp-deploy:0.3.7
    staging:
      - step:
          name: BAMS::STAGING
          services:
            - docker
          caches:
            - node
          script:
            - npm install
            - npm run build-staging
            - pipe: atlassian/ftp-deploy:0.3.7
              variables:
                USER: $FTP_USER
                PASSWORD: $FTP_PASS
                SERVER: $FTP_HOST
                REMOTE_PATH: $REMOTE_PATH
                LOCAL_PATH: "/"
                DELETE_FLAG: 'false'
