image: fischerscode/flutter

pipelines:
  branches:
    main:
      - step:
          name: Compile Flutter Web
          caches:
            - gradle
          script:
            - flutter channel stable
            - flutter upgrade
            #- flutter config --enable-web
            - flutter pub get
            - echo "Building Web"
            - flutter build web
          artifacts:
            - build/web/**
      - step:
          name: Deploy Web to fTP
          script:
            - apt-get update && apt-get install -y ncftp
            - ncftpput -v -u "$FTP_USERNAME" -p "$FTP_PASSWORD" -R $FTP_HOST $FTP_SITE_ROOT build/web/* 
            - echo Finished uploading /build files to $FTP_HOST$FTP_SITE_ROOT
#      - step: *build-step
