Pushing to a Development Server
Follow these steps to create a new subdomain, configure DNS settings, set up the database, and deploy your WordPress site. This process ensures a smooth transition from local development to a staging environment where you can test your site before pushing to production.
-
Login to VentraIP:
- Access VentraIP and navigate to the cPanel for
perth.agency.
- Access VentraIP and navigate to the cPanel for
-
Create a New Domain:
- In cPanel, create a new domain, e.g.,
sitename.startdigital.com.au. - Untick
Share document rootand set the document root to a simple name likesitename.
- In cPanel, create a new domain, e.g.,
-
Configure DNS in Cloudflare:
- Log in to Cloudflare and navigate to the DNS settings for startdigital.com.au.
- Create an A record with the name as
sitenameand the IPv4 address as the IP address listed on cPanel. - Ensure the name matches the domain created within cPanel and proxy is turned off.
-
Set Up MySQL Database:
- In cPanel, go to
MySQL® Databases. - Create a new database, a database user, and add the user to the database with all permissions.
- In cPanel, go to
-
Upload WordPress Core:
- Access the
File Managerin cPanel, locate thesitenamefolder. - Upload and extract the WordPress core into this folder.
- Access the
-
Install WordPress:
- Navigate to the domain, e.g.,
sitename.startdigital.com.au, and proceed with the standard WordPress setup.
- Navigate to the domain, e.g.,
-
Install WP Migrate Plugin:
- Install the WP Migrate plugin on both the local site and the development site.
-
Migrate Content:
- On the local site, navigate to Tools > WP Migrate and select 'push'.
- Create a find and replace rule for 'http://' with 'https://'.
- Select all options except themes and proceed with the migration.
-
Edit GitHub Workflow:
- Modify the
deploy.yamlfile within your.github/workflowsdirectory. - Change the
server-dirto the domain document root created earlier, e.g.,sitename/.
- Modify the
-
Configure FTP Credentials:
- In VentraIP, click manage on
perth.agencyto find the username and password. - Enter the username into the
deploy.yaml. - In the GitHub repository, go to Settings > Secrets & Variables > Repository Secret, and create a
DEV_FTP_PASSsecret containing the FTP password.
- In VentraIP, click manage on
-
Deploy Changes:
- Push the changes to GitHub and monitor the GitHub Actions to ensure the deployment is successful on the server.