|
| 1 | +> **⚠️ Note:** To use this GitHub Action, you must have access to GitHub Actions. GitHub Actions are currently only available in public beta. You can [apply for Github Actions beta access here](https://github.com/features/actions). |
| 2 | +
|
| 3 | +# WordPress.org Plugin Deploy - ***Github Action*** |
| 4 | +This Action commits the contents of your Git tag to the WordPress.org plugin repository using the same tag name. |
| 5 | +It excludes Git-specific items or files and directories as optionally defined in your `.wporgignore` file, and |
| 6 | +moves anything from a `.wordpress-org` subdirectory to the top-level `assets` directory in Subversion (plugin banners, icons, and screenshots). |
| 7 | + |
| 8 | +## Configuration |
| 9 | +### Required secrets |
| 10 | +* `WORDPRESS_USERNAME` |
| 11 | +* `WORDPRESS_PASSWORD` |
| 12 | +* `GITHUB_TOKEN` - you do not need to generate one but you do have to explicitly make it available to the Action |
| 13 | + |
| 14 | +Secrets can be set while editing your workflow or in the repository settings. They cannot be viewed once stored. [GitHub secrets documentation](https://developer.github.com/actions/creating-workflows/storing-secrets/) |
| 15 | + |
| 16 | +### Optional environment variables |
| 17 | +* `SLUG` - defaults to the respository name, customizable in case your WordPress repository has a different slug. This should be a very rare case as WordPress assumes that the directory and initial plugin file have the same slug. |
| 18 | +* `VERSION` - defaults to the tag name; do not recommend setting this except for testing purposes |
| 19 | +* `ASSETS_DIR` - defaults to `.wordpress-org`, customizable for other locations of WordPress.org plugin repository-specific assets that belong in the top-level `assets` directory (the one on the same level as `trunk`) |
| 20 | +* `IGNORE_FILE` - defaults to `.wporgignore`, customizable for other locations of list of files to be ignore like `.gitignore` |
| 21 | + |
| 22 | +### Excluding files from deployment |
| 23 | +If there are files or directories to be excluded from deployment, such as tests or editor config files, they can be specified in your `.wporgignore` file. If you use this method, please be sure to include the following items: |
| 24 | + |
| 25 | +```gitignore |
| 26 | +# Directories |
| 27 | +.wordpress-org |
| 28 | +.github |
| 29 | +
|
| 30 | +# Files |
| 31 | +/.gitattributes |
| 32 | +/.gitignore |
| 33 | +``` |
| 34 | + |
| 35 | +> **⚠️ Note:** You Should Provide Github Token. If Not No Updated File Will Be Committed & Pushed |
| 36 | +
|
| 37 | +## Example Workflow File |
| 38 | +```yaml |
| 39 | +name: Deploy to WordPress.org |
| 40 | +on: |
| 41 | + push: |
| 42 | + branches: |
| 43 | + - refs/tags/* |
| 44 | +jobs: |
| 45 | + tag: |
| 46 | + name: New tag |
| 47 | + runs-on: ubuntu-latest |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@master |
| 50 | + - name: WordPress Plugin Deploy |
| 51 | + uses: 10up/action-wp-org-deploy@master |
| 52 | + with: |
| 53 | + WORDPRESS_PASSWORD: ${{ secrets.WORDPRESS_PASSWORD }} |
| 54 | + WORDPRESS_USERNAME: ${{ secrets.WORDPRESS_USERNAME }} |
| 55 | + SLUG: my-super-cool-plugin |
| 56 | + env: |
| 57 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 58 | +``` |
| 59 | +
|
| 60 | +## Credits |
| 61 | +This Github Action Bootstrapped From |
| 62 | +* [10up/action-wordpress-plugin-deploy](https://github.com/10up/action-wordpress-plugin-deploy) |
| 63 | +* [rtCamp/action-wordpress-org-plugin-deploy](https://github.com/10up/rtCamp/action-wordpress-org-plugin-deploy) |
| 64 | +
|
| 65 | +--- |
| 66 | +## Contribute |
| 67 | +If you would like to help, please take a look at the list of |
| 68 | +[issues][issues] or the [To Do](#-todo) checklist. |
| 69 | +
|
| 70 | +## License |
| 71 | +Our GitHub Actions are available for use and remix under the MIT license. |
| 72 | +
|
| 73 | +## Copyright |
| 74 | +2017 - 2018 Varun Sridharan, [varunsridharan.in][website] |
| 75 | +
|
| 76 | +If you find it useful, let me know :wink: |
| 77 | +
|
| 78 | +You can contact me on [Twitter][twitter] or through my [email][email]. |
| 79 | +
|
| 80 | +## Backed By |
| 81 | +| [![DigitalOcean][do-image]][do-ref] | [![JetBrains][jb-image]][jb-ref] | [![Tidio Chat][tidio-image]][tidio-ref] | |
| 82 | +| --- | --- | --- | |
| 83 | +
|
| 84 | +[twitter]: https://twitter.com/varunsridharan2 |
| 85 | +[email]: mailto:varunsridharan23@gmail.com |
| 86 | +[website]: https://varunsridharan.in |
| 87 | +[issues]: issues/ |
| 88 | +
|
| 89 | +[do-image]: https://vsp.ams3.cdn.digitaloceanspaces.com/cdn/DO_Logo_Horizontal_Blue-small.png |
| 90 | +[jb-image]: https://vsp.ams3.cdn.digitaloceanspaces.com/cdn/phpstorm-small.png?v3 |
| 91 | +[tidio-image]: https://vsp.ams3.cdn.digitaloceanspaces.com/cdn/tidiochat-small.png |
| 92 | +[do-ref]: https://s.svarun.in/Ef |
| 93 | +[jb-ref]: https://www.jetbrains.com |
| 94 | +[tidio-ref]: https://tidiochat.com |
| 95 | +
|
0 commit comments