Skip to content

🌐 Leggi in Italiano

CI/CD with GitHub Actions and FTP: a practical guide

Automate building and publishing a static site on every push to the main branch, using GitHub secrets for the FTP credentials.

Alessandro Manias Alessandro Manias Published on · Updated on · 1 min read
Pipeline with three stages: install, build and deploy

Uploading files by hand over FTP is slow and error-prone. With GitHub Actions we can make deployment fully automatic.

The secrets

In the repository go to Settings → Secrets and variables → Actions and create:

SecretExample
FTP_SERVERftp.mydomain.com
FTP_USERNAMEuser@mydomain.com
FTP_PASSWORD••••••••

The workflow

The flow is simple: checkout, installing dependencies with npm ci, build, and syncing the build/ folder.

- name: Deploy via FTP
  uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  with:
    server: ${{ secrets.FTP_SERVER }}
    username: ${{ secrets.FTP_USERNAME }}
    password: ${{ secrets.FTP_PASSWORD }}
    local-dir: ./build/

The action keeps a state file on the server and uploads only the files that changed, making subsequent deployments very fast.

© 2026 Wordpress e PHP. Statically generated with SvelteKit.