Skip to content

When cutting the head of Wordpress and replacing it with something like Gatsby on GitHub, this plugin allows you to publish your content changes in GitHub via GitHub Actions

Notifications You must be signed in to change notification settings

ch264/WP-GH-actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy headless Frontend

Tested up to WordPress v5.6.1

License

License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html

Description

A WordPress Plugin to push new pages or updates from your headless WordPress CMS to a Frontend, such as a Gatsby App on AWS via GitHub Actions.

Prerequisites

  • Your WordPress CMS has already been connected to your Gatsby App. If not, this Youtube video will help you get started.
  • Your Gatsby App has been successfully deployed to AWS/S3 using GitHub Actions. (If not you can check out this Blog Post by Anna Aitchison) At this time, GitHub does not provide a re-run button for GitHub Actions. I have written a concise tutorial on how to run GitHub Actions manually using Postman client.

The Workflow

Here is what you need to do in order to get this plugin to work

  • Create a folder containing one PHP file
  • Hook into WordPress actions to create admin dashboard menu item
  • Create a button with onClick to POST to GitHub Actions API to re-publish the Gatsby App to AWS/S3
  • Create a personal token in GitHub to use for GitHub Actions API authorization
  • Create zip file of plugin folder, upload to WordPress and activate

How to install the plugin

  • Download the plugin and insert your details into the code. You can do so with Vim or by opening up the php file in a code editor such as VSCode
  • Log into your Wordpress and navigate to 'Add new plugin'
  • Upload the folder and activate the plugin

For all steps on how to setup a WordPress/GitHub Action integration with this plugin please follow my Twilio Tutorial

Screenshots

This is the admin page of the 'Deploy to GitHub Actions' plugin. You can add/delete buttons to deploy to your GitHub branches if you wish. Please remember to download the plugin and insert your GitHub details before zipping it back up and uploading the plugin.

Deploy to GitHub Actions Admin Page on WordPress

Once you hit either of the buttons, you will receive a success message that your GitHub Action is running.

Deploy to GitHub Actions Admin Page on WordPress success message

About

When cutting the head of Wordpress and replacing it with something like Gatsby on GitHub, this plugin allows you to publish your content changes in GitHub via GitHub Actions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages