|
1 |
| -# GoDaddy GitHub Action for Wordpress deployment |
| 1 | +# GoDaddy GitHub Action for Managed WordPress Deployment |
2 | 2 |
|
3 | 3 | ## Overview
|
4 | 4 |
|
5 |
| -This GitHub Action automates WordPress deployment using `rsync` over SSH. It creates a tar archive of modified files, transfers it to the remote server, and executes a deployment script. The action supports post-deployment commands, WordPress health checks, and automatic rollback in case of failures. |
| 5 | +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: |
| 6 | +- Post-deployment commands |
| 7 | +- WordPress health checks with automatic rollback upon failure |
| 8 | +- Secure authentication using an SSH private key |
6 | 9 |
|
7 | 10 | ## Features
|
8 | 11 |
|
9 |
| -- **Deploy only changed files** using `rsync --checksum` |
10 |
| -- **Remove deleted files** from the repository on the server |
11 |
| -- **Execute post-deployment commands** |
12 |
| -- **Perform WordPress health checks** and rollback if necessary |
13 |
| -- **Secure authentication** via SSH private key |
| 12 | +- **Deploy Only Changed Files:** Uses `rsync --checksum` to efficiently update only the modified files. |
| 13 | +- **Sync File Deletions:** Automatically removes files deleted from the repository on the server. |
| 14 | +- **WordPress Health Checks:** Monitor site health and trigger a rollback on failure. |
| 15 | +- **Secure SSH Authentication:** Ensures connectivity using your SSH private key. |
14 | 16 |
|
15 | 17 | ## Usage
|
16 | 18 |
|
17 |
| -### 1. **Add the Action to Your Workflow** |
| 19 | +### 1. Add the Action to Your Workflow |
18 | 20 |
|
19 |
| -Create a `.github/workflows/deploy.yml` file in your repository: |
| 21 | +Create a `.github/workflows/deploy.yml` file in your repository with the following content: |
20 | 22 |
|
21 | 23 | ```yaml
|
22 | 24 | name: Deploy WordPress
|
|
25 | 27 | workflow_dispatch:
|
26 | 28 | inputs:
|
27 | 29 | deployment_dest:
|
28 |
| - description: 'Target server directory, leave blank for root directory' |
| 30 | + description: 'Target server directory; leave blank for the root directory' |
29 | 31 | required: false
|
30 | 32 | enable_health_check:
|
31 |
| - description: 'Enable wordpress health check?' |
| 33 | + description: 'Enable WordPress health check?' |
32 | 34 | type: choice
|
33 | 35 | required: false
|
34 | 36 | default: "yes"
|
35 | 37 | options:
|
36 | 38 | - "yes"
|
37 | 39 | - "no"
|
| 40 | + |
38 | 41 | jobs:
|
39 | 42 | deploy:
|
40 | 43 | runs-on: ubuntu-latest
|
41 | 44 | steps:
|
42 |
| - - name: Checkout repository |
| 45 | + - name: Checkout Repository |
43 | 46 | uses: actions/checkout@v3
|
44 | 47 |
|
45 |
| - - name: Deploy using GitHub Action |
46 |
| - uses: your-org/your-action-repo@v1 |
| 48 | + - name: Deploy via GoDaddy GitHub Action |
| 49 | + uses: godaddy-wordpress/[email protected] |
47 | 50 | with:
|
48 |
| - remote_host: ${{ secrets.REMOTE_HOST }} |
49 |
| - ssh_user: ${{ secrets.SSH_USER }} |
50 |
| - ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 51 | + remote_host: 'http://your-wordpress-site.com' |
| 52 | + ssh_user: 'SSH_USERNAME_FROM_GODADDY_INTERFACE' |
| 53 | + ssh_private_key: ${{ secrets.PRIVATE_KEY }} |
51 | 54 | deployment_dest: ${{ github.event.inputs.deployment_dest }}
|
52 | 55 | enable_health_check: ${{ github.event.inputs.enable_health_check }}
|
53 | 56 | ```
|
54 | 57 |
|
55 |
| -## Inputs |
| 58 | +### 2. Configuration Inputs |
56 | 59 |
|
57 | 60 | | Name | Description | Required | Default |
|
58 |
| -| ----------------------- | ------------------------------------ | -------- | ------- | |
59 |
| -| `remote_host` | The remote server IP or domain | ✅ Yes | - | |
60 |
| -| `ssh_user` | SSH username for authentication | ✅ Yes | - | |
61 |
| -| `ssh_private_key` | SSH private key for authentication | ✅ Yes | - | |
62 |
| -| `deployment_dest` | Remote WordPress directory | ❌ No | `.` | |
63 |
| -| `post_deploy_commands` | Commands to run after deployment | ❌ No | `''` | |
64 |
| -| `cleanup_deleted_files` | Remove deleted files from the server | ❌ No | `yes` | |
65 |
| -| `enable_health_check` | Perform a WordPress health check | ❌ No | `yes` | |
66 |
| - |
67 |
| -## Requirements |
68 |
| - |
69 |
| -- **Enable Git Deployment** for site from GoDaddy interface |
70 |
| -- **GitHub secrets configured** for `REMOTE_HOST`, `SSH_USER`, and `SSH_PRIVATE_KEY` |
71 |
| - |
72 |
| -## Troubleshooting |
| 61 | +| ----------------------- | ------------------------------------ | -------- | ------ | |
| 62 | +| `remote_host` | The remote server IP or domain | ✅ Yes | - | |
| 63 | +| `ssh_user` | SSH username for authentication | ✅ Yes | - | |
| 64 | +| `ssh_private_key` | SSH private key for authentication | ✅ Yes | - | |
| 65 | +| `deployment_dest` | Remote WordPress directory | ❌ No | `''` | |
| 66 | +| `enable_health_check` | Perform a WordPress health check | ❌ No | `yes` | |
73 | 67 |
|
74 |
| -### SSH Key Issues |
75 | 68 |
|
76 |
| -Ensure the private key format is correct and matches the server's authorized keys: |
| 69 | +### Requirements |
| 70 | +- Git Deployment Enabled: Activate Git Deployment for your site via the GoDaddy control panel. |
| 71 | +- GitHub Secrets: Ensure the following secrets are configured in your repository: |
| 72 | + - `PRIVATE_KEY` |
77 | 73 |
|
78 | 74 | ```bash
|
79 | 75 | cat ~/.ssh/id_rsa | base64
|
80 | 76 | ```
|
| 77 | +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.) |
81 | 78 |
|
82 |
| -Set the output as `SSH_PRIVATE_KEY` in GitHub Secrets. |
| 79 | +### For additional troubleshooting: |
83 | 80 |
|
84 |
| -## License |
| 81 | +- Double-check your remote host details. |
| 82 | +- Consult the issues tab in this repository for similar problems and their resolution. |
85 | 83 |
|
86 |
| -This action is licensed under the MIT License. |
| 84 | +### License |
87 | 85 |
|
88 |
| -## Contributing |
| 86 | +This GitHub Action is licensed under the MIT License. |
89 | 87 |
|
90 |
| -Feel free to open issues or submit PRs for improvements! |
| 88 | +### Contributing |
91 | 89 |
|
92 |
| -## Support |
93 |
| - |
94 |
| -For help, open an issue in the repository. |
| 90 | +Contributions, bug reports, and ideas for improvements are welcome! Please open an issue or submit a pull request for discussion. |
95 | 91 |
|
| 92 | +## Support |
| 93 | +For additional help or support, please open an issue in this repository. |
0 commit comments