{"id":2730,"date":"2023-01-26T20:04:18","date_gmt":"2023-01-26T23:04:18","guid":{"rendered":"https:\/\/felipeelia.com.br\/?p=2730"},"modified":"2023-01-26T20:21:51","modified_gmt":"2023-01-26T23:21:51","slug":"ftp-no-more-deploying-wordpress-sites-with-github-actions","status":"publish","type":"post","link":"https:\/\/felipeelia.dev\/ftp-no-more-deploying-wordpress-sites-with-github-actions\/","title":{"rendered":"FTP No More: Deploying WordPress sites with GitHub Actions"},"content":{"rendered":"\n
Do you still use FileZilla to send files one by one to the server? It is time to change! After reading this post all you will need is to push a file to a GitHub repository and it will be automatically sent to your server.<\/p>\n\n\n\t\t\t\t
There is no problem if you are in a hurry. In summary, this is what we are going to do:<\/p>\n\n\n\n
DEPLOY_SSH_HOST<\/code>, DEPLOY_SSH_USER<\/code>, and DEPLOY_SSH_KEY<\/code> secrets in GitHub<\/a>;<\/li>\n\n\n\n- Create the
bin\/rsync-excludes.txt<\/code> file in your repository<\/a>;<\/li>\n\n\n\n- Create the
.github\/workflows\/deploy.yml<\/code> file in your repository<\/a>;<\/li>\n\n\n\n- Make any changes in the
trunk<\/code> branch.<\/li>\n<\/ol>\n\n\n\n\nIf this post helps you, don’t forget to share it. Also subscribe to the newsletter to receive new posts!<\/p>\n<\/blockquote>\n\n\n\n
What you need<\/h2>\n\n\n\n
The list of things you need for this post is quite simple:<\/p>\n\n\n\n
\n- SSH Acess to your server<\/strong>: Available in almost all host providers nowadays;<\/li>\n\n\n\n
- A GitHub repository<\/strong>: Free and unlimited, including private ones.<\/li>\n<\/ul>\n\n\n\n
Don’t forget to back up your files before you continue. If something goes wrong you will have a way to revert it.<\/p>\n\n\n\n
What the GitHub Action will do<\/h2>\n\n\n\n
Basically, when a file in a certain branch is updated, a GitHub Action will connect to your server via SSH and send the files<\/strong> using the rsync<\/code> command.<\/p>\n\n\n\n