Check out example codes for "hugo deployment to ftp automatic". It will help you in understanding the concepts better.

Code Example 1

name: Publish

on:
  push:
    branches:
    - master
  schedule:
    - cron:  '0 8 * * *'

jobs:
  Deploy:
    runs-on: ubuntu-latest
    steps:

    - uses: actions/[email protected]
      with:
        submodules: true

    - name: Setup Hugo
      uses: peaceiris/[email protected]
      with:
        hugo-version: '0.62.0'

    - name: Build
      run: hugo -D

    - name: Deploy
      uses: SamKirkland/[email protected]
      env:
        FTP_SERVER: ftp.myhosing.com
        FTP_USERNAME: myusername
        FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
        LOCAL_DIR: ./public/
        REMOTE_DIR:  /path/to/site/root/on/my/hosting/
        ARGS: --delete # will delete files on the server if you've deleted them in git

Learn ReactJs, React Native from akashmittal.com