Configuring BitBucket pipelines for deploying to FTP site

This is the code I have used in my bitbucket-pipelines.yml file to successfully deploy a BitBucket repo to my server using FTP:

- step:
- apt-get update
- apt-get -qq install git-ftp
- git ftp init --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://YOUR_WEBSITE_URL

Note: after the first commit, change the last line to:

- git ftp commit --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://YOUR_WEBSITE_URL

Of course make sure to set up the FTP_USERNAME and FTP_PASSWORD variables under Settings > Environment Variables.