This is deployment action for WordPress Plugin from Git repository to SubVersion on WordPress.org.
Your WordPress Plugin project can accept that:
- Tag revision on Git repository before deploy into WordPress.org
- Tag name of revision on source Git repository to deploy is the same as version number of plugin’s main PHP file on tagged revision of source Git repository
- Deploying old version than latest version
- Deploying Assets (Even if Git repository includes assets, this project will deploy the revision content as it is under trunk and tags of SubVersion repository on WordPress.org.)
The process executes rsync from Git working tree to SubVersion working tree with .rsync-filter
.
rsync will read default .rsync-filter file.
If .rsync-filter
file is exist on the root of Git working tree, rsync will read it. The most primitive how to write it is to list up files and directories you want to exclude. For more details, following contents will be helpful.
The code example is given first and some key points are explained later.
Ex:
name: Deploy WordPress plugin
on:
push:
# 1. Trigger by pushing tag
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
name: Deploy WordPress plugin
# 2. Specify Linux runner
runs-on: ubuntu-20.04
steps:
# 3. Checkout before Use this deployment action
- name: Checkout
uses: actions/checkout@v3
# 4. Use action with environment variable set by secrets
- name: Deploy
uses: yukihiko-shinoda/action-deploy-wordpress-plugin@v2
env:
SVN_REPOSITORY_URL: ${{ secrets.SvnRepositoryUrl }}
SVN_USER_NAME: ${{ secrets.SvnUserName }}
SVN_USER_PASSWORD: ${{ secrets.SvnUserPassword }}
If you prefer, you can use filter pattern.
We recommend Linux runner. Windows and Mac also may use this action, however we are not running test on these environment to save testing cost now.
This deployment action assumes that the Git repository has been checked out.
In this example, environment variables are presented by secrets. At least, you'd better to use secret for SVN_USER_NAME
and SVN_USER_PASSWORD
.