GithubHelp home page GithubHelp logo

moritzgvt / versioned-wordpress-starter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 82 KB

Versioned wordpress starter theme with Webpack build and Github action to deploy to your hosting provider

PHP 80.04% JavaScript 6.49% SCSS 12.33% CSS 1.15%
automated-deployment cicd continuous-integration github-actions-enabled nodejs npm scss webpack wordpress wordpress-development

versioned-wordpress-starter's Introduction

Versioned Wordpress Theme

Versioned Wordpress theme with Webpack build and Github Actions workflow to deploy to your hosting.

This is a low-fi boilerplate to start developing a wordpress theme with versioning and automated deployment. In the following you will find a description on how to setup and use it. Hope this makes your work a bit faster and cleaner ๐Ÿ˜˜


Prerequisites

  1. NodeJS 14 and NPM 9
  2. Local Apache, MySQL, PHP Stack (eg. MAMP)
  3. Wordpress
  4. Hosting with SSH Access (Wordpress already installed)
  5. Empty Github repository

Usage

1. Fork it

Fork this repository.

2. Clone your fork to the theme folder of your local wordpress installation

cd your-wp-root-folder/wp-content/themes
git clone [email protected]:moritzgvt/versioned-wordpress-starter.git

2. Install dependencies

npm install

3. Start development build process

npm run start

4. Working with it

Make changes and commit them. If you want to add additional folders, you need to add them in the Webpack config file


Deployment

1. Create target

Create an empty theme folder inside the themes folder on your hosting (eg. my-theme)

2. Add the deployment secrets to your repository

REMOTE_PRIVATE_KEY

  • Generate a new ssh key pair.
  • Place the public key on your hosting side (eg. in ~/.ssh/authorized_keys).
  • Use the private key for the Github repository secret.

Warning: The key has to be an RSA Private Key: It begins with -----BEGIN RSA PRIVATE KEY----- Use this command for creation on unix systems ssh-keygen -m PEM -t rsa -b 4096 -C "[email protected]"

REMOTE_HOST

The host you're connecting to via SSH.

REMOTE_USER

The SSH User you're given by your hosting provider.

REMOTE_PORT

Normally 22.

REMOTE_TARGET

The path to your wp theme folder, normally something like this: html/worpdress/wp-content/themes/my-theme

3. Trigger the deployment

Go to your Github repository and trigger the deployment in the Actions tab.

4. Active the theme

After the first successful workflow run you can log into your Wordpress instance and activate the theme. If links are not working go to Settings > Permalinks and save your desired settings.

Note: If you're having regular changes it might make sense to have some kind of staging where the deployment goes. And a hoster-side plublishing process.

versioned-wordpress-starter's People

Contributors

moritzgvt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.