Automattic / Automattic/crowdsignal-plugin

Switch to GitHub Actions workflow for deploy to WordPress.org

Open
#122 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
15
Forks
11
Avg merge
14m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**

Having to run `npm install`, `npm run build`, `npm run deploy` as wrappers of a Grunt dependency (and Grunt-extension dependencies), which involves cleaning directories, copying files, with exclusions, and remembering to do it after a release on GitHub, seems like extra work and effort.

**Describe the solution you'd like**
With a one-time switch to a [commonly-used custom action for deploying to WPORG](https://github.com/10up/action-wordpress-plugin-deploy), this task can be handled automatically on each GitHub release.

Here's a starting point:

```yml
name: Deploy to WordPress.org
on:
release:
types: [released]
# Allow manual triggering of the workflow.
workflow_dispatch:

permissions: {}

jobs:
release:
name: New release to WordPress.org
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install SVN (Subversion)
run: |
sudo apt-get update
sudo apt-get install subversion

- name: Push to WordPress.org
uses: 10up/action-wordpress-plugin-deploy@54bd289b8525fd23a5c365ec369185f2966529c2 # 2.3.0
env:
SLUG: polldaddy
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
BUILD_DIR: tmp/build
```

You'll notice that this includes a build directory config at the bottom - by using a `.deployignore` file to contain the [exclusions](https://github.com/Automattic/crowdsignal-plugin/blob/2771eae9dbdbc64576ff1b32ae020c388d868c81/Gruntfile.js#L20-L32) then this "copy the things we actually want to deploy to a new folder" step can be dropped.

Contributor guide

Open the contributing guide

Research direction

Read the existing deployment exclusions in Gruntfile.js lines 20-32 and compare them with the proposed .deployignore approach. Check the GitHub Actions and action-wordpress-plugin-deploy documentation, then verify that a release and manual workflow can deploy with the stated SVN secrets and that the resulting package contains only the intended files.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, php, wordpress, yaml
Domain
ci-cd, devops, release
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.