Skip to content

Test build plugins

Test build plugins #2

name: Build changed plugins
on:
push:
branches: ["main"]
paths: ["plugins/**"]
pull_request:
paths: ["plugins/**"]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Set up base packages
run: ./npm-install.sh
- name: Build changed plugins
run: |
# Get the list of changed directories in /plugins
changed_dirs=$(git diff --name-only HEAD^ HEAD /plugins | awk -F/ '{print $2}' | uniq)
# Loop through each changed directory
for dir in $changed_dirs; do
cd "/plugins/$dir" || continue
# Run npm install
npm install
# Run npm run build
npm run build
cd - >/dev/null || continue
done