Skip to content

Try to install CLI in action #2

Try to install CLI in action

Try to install CLI in action #2

name: Detect Changed Folders on Merge to Main
on:
push:
branches:
- main
jobs:
detect-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get widgets with changes
id: changed
run: |
folders=$(git diff --name-only HEAD^ HEAD | cut -d/ -f1 | sort -u)
echo "changed_folders<<EOF" >> $GITHUB_OUTPUT
echo "$folders" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Install CLI
run: npm i -g @vev/cli
- name: Deploy widgets
run: |
for folder in ${{ steps.changed.outputs.changed_folders }}; do
if [ -f "$folder/vev.json" ]; then
echo "Deploying $folder"
(cd "$folder" && vev deploy -m "${{ github.sha }}")
else
echo "Skipping $folder (no vev.json)"
fi
done