Repository navigation
60 lines (54 loc) · 2 KB
/
Copy pathdeploy.yml
File metadata and controls
60 lines (54 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: "Deploy to WordPress.org and create release on GitHub"
on:
push:
tags:
- "v*"
jobs:
tag:
name: New tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
# The plugin's classes load through the Composer autoloader, and its
# admin CSS/JS are build artifacts. None of those files are in git:
# vendor/ and the dist files are gitignored. Build them into the
# workspace first, or the deploy would sync a broken plugin to
# WordPress.org (the action deletes files in SVN that are not in
# the build).
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
- name: Install Composer dependencies
uses: ramsey/composer-install@v4
with:
composer-options: '--no-dev'
- name: Build admin CSS and JS
run: |
npx -y esbuild css/src/clicky_admin.css --minify --outfile=css/dist/clicky_admin.css
npx -y esbuild css/src/adminbar.css --minify --outfile=css/dist/adminbar.css
npx -y esbuild js/admin.js --minify --outfile=js/admin.min.js
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: clicky # optional, remove if GitHub repo name matches SVN slug, including capitalization
ASSETS_DIR: svn-assets
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false