This GitHub Action can be used to deploy your repo/branch from Github to a One.com site using SSH and a prefashioned rsync protocol. Deploy a theme, plugin or other directory with the TPO options. Post deploy, this action will automatically purge your ite cache to ensure all changes are visible.
-
Create a
.github/workflows/main.yml
file in your root of your WordPress project/repo, if one doesn't exist already. -
Add the following to the
main.yml
file, replacing <yourdomainname.com> and the public and private key var names if they were anything other than what is below. Consult "Furthur Reading" on how to setup keys in repo Secrets. -
Git push your site repo.
name: Deploy to One.com
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: GitHub Deploy to One.com
uses: rostimelk/one.com-deployer@master
env:
ONE_DOMAIN_NAME: yourdomainname.com
ONE_SSH_KEY_PUBLIC: ${{ secrets.PUBLIC_KEY_NAME }}
ONE_SSH_KEY_PRIVATE: ${{ secrets.PRIVATE_KEY_NAME }}
TPO_SRC_PATH: ""
TPO_PATH: ""
Name | Type | Usage |
---|---|---|
ONE_DOMAIN_NAME |
Environment Variable | Insert the domain name of the One.com site you want to deploy to. |
ONE_SSH_KEY_PRIVATE |
Secret | Private SSH Key for deployment. See below for SSH key usage. |
ONE_SSH_KEY_PUBLIC |
Secret | Public SSH Key for deployment. See below for SSH key usage and how to add your public key to One.com. |
Name | Type | Usage |
---|---|---|
TPO_SRC_PATH |
Optional path to specify a theme, plugin, or other directory source to deploy from. Ex. "wp-content/themes/your-theme-here/" . Defaults to "." Dir. |
|
TPO_PATH |
Optional path to specify a theme, plugin, or other directory destination to deploy to. Ex. "wp-content/themes/your-theme-here/" . Defaults to root directory. |
-
Generate a new SSH key pair as a special deploy key between your Github Repo and One.com. The simplest method is to generate a key pair with a blank passphrase, which creates an unencrypted private key.
-
Store your public and private keys in the GitHub repository of your website as new 'Secrets' (under your repository settings) using the names
PRIVATE_KEY_NAME
andPUBLIC_KEY_NAME
respectively with the name in your specfic files. These can be customized, just remember to change the var in the yml file to call them correctly.
- SSH in to your One.com install using terminal.
- Without navigating to any path, create a .ssh folder with:
$ mkdir .ssh
. - Navigate into your folder:
$ cd .ssh
. - Create an empty file in the folder called authorized_keys:
$ touch authorized_keys
. - In the authorized_keys file, you want to add your SSH public key that you generated before. You can do this using nano:
$ nano authorized_keys
. - Paste in your key.
- To exit nano, click Ctrl + X . If you ask nano to exit from a modified file, it will ask you if you want to save it. Press Y to save the file.
- You can not safely exit SSH by typing:
$ exit
.