This GitHub Action automates the deployment of your WordPress site by leveraging rsync
over SSH. It packages only modified files into a tar archive, transfers them to your remote server, and executes a tailored deployment script. In addition, the action supports:
- Post-deployment commands
- WordPress health checks with automatic rollback upon failure
- Secure authentication using an SSH private key
- Deploy Only Changed Files: Uses
rsync --checksum
to efficiently update only the modified files. - Sync File Deletions: Automatically removes files deleted from the repository on the server.
- WordPress Health Checks: Monitor site health and trigger a rollback on failure.
- Secure SSH Authentication: Ensures connectivity using your SSH private key.
Create a .github/workflows/deploy.yml
file in your repository with the following content:
name: Deploy WordPress
on:
workflow_dispatch:
inputs:
deployment_dest:
description: 'Target server directory; leave blank for the root directory'
required: false
enable_health_check:
description: 'Enable WordPress health check?'
type: choice
required: false
default: "yes"
options:
- "yes"
- "no"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Deploy via GoDaddy GitHub Action
uses: godaddy-wordpress/[email protected]
with:
remote_host: 'http://your-wordpress-site.com'
ssh_user: 'SSH_USERNAME_FROM_GODADDY_INTERFACE'
ssh_private_key: ${{ secrets.PRIVATE_KEY }}
deployment_dest: ${{ github.event.inputs.deployment_dest }}
enable_health_check: ${{ github.event.inputs.enable_health_check }}
Name | Description | Required | Default |
---|---|---|---|
remote_host |
The remote server IP or domain | ✅ Yes | - |
ssh_user |
SSH username for authentication | ✅ Yes | - |
ssh_private_key |
SSH private key for authentication | ✅ Yes | - |
deployment_dest |
Remote WordPress directory | ❌ No | '' |
enable_health_check |
Perform a WordPress health check | ❌ No | yes |
- Git Deployment Enabled: Activate Git Deployment for your site via the GoDaddy control panel.
- GitHub Secrets: Ensure the following secrets are configured in your repository:
PRIVATE_KEY
cat ~/.ssh/id_rsa | base64
Copy the output and configure it as your repository's SSH_PRIVATE_KEY secret. (Note: You may have used a different name when creating your key. Please ammend the example to match your case.)
- Double-check your remote host details.
- Consult the issues tab in this repository for similar problems and their resolution.
This GitHub Action is licensed under the MIT License.
Contributions, bug reports, and ideas for improvements are welcome! Please open an issue or submit a pull request for discussion.
For additional help or support, please open an issue in this repository.