Categories
Technology

How to Automate the Wordpress Plugin Upload With Github Actions ?

Hello Friends, πŸ‘‹ today we will learn about something interesting which is automation for wordoress svn repository.

Automation is fun and make us more productive.

Introduction

I recommand you to open side by side this github link Plugin Repo to understand properly.

First of all we need atleast one plugin hosted in the Wordpress Plugin directory.

Get started

  • Upload Your plugin to github

  • after uplaoding your plugin

goto actions > setup new workflow yourself

setup new workflow in github

Click To Copy Workflow File and paste on your File.

change the plugin url and other stuff that you want to ingnore.Like i have ingnored readme.md etc.

Creating Secrets on Github

For Doing That goto settings of Repository.

Click on Secret Tab.

Screenshot from 2020-07-05 17-50-31

Then add New As mentions in the Workflow file.

WORDPRESS_PASSWORD

WORDPRESS_USERNAME

By doing this setup done.

How to upload on wordpress

As mentions on Workflow file we will run this setup on every tag release.

name: Deploy
on:
  push:
    tags:
      - '*'
jobs:
  tag:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - name: WordPress Plugin Deploy
      #see rtCamp  repo for the 
      uses: rtCamp/[email protected]
      env:
        #CUSTOM_COMMAND: ''
        #CUSTOM_PATH: ''
        EXCLUDE_LIST: docker-compose.yml README.md _config.yml
        SLUG: wp-post-views
        WORDPRESS_PASSWORD: ${{ secrets.WORDPRESS_PASSWORD }}
        WORDPRESS_USERNAME: ${{ secrets.WORDPRESS_USERNAME }}

To release tag Goto your Release Then Click Draft a new Release.

when you create new relese do not forgot to change your plugin version and readme.txt file version


If it is helpfulΒ and saves your valuable Time ⏱ please show your support πŸ‘‡.

Buy Me A Coffee

Buy me A Coffee, Thank you and canva ( For Beautiful designs ). Thanks for the reading πŸ‘.