-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.39 KB
/
Copy pathbuild.yml
File metadata and controls
55 lines (45 loc) · 1.39 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
name: Build and Commit
on:
push:
branches:
- master
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build the script
run: npm run build
- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain dist/)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add dist/
git commit -m "build: Generate minified script [skip ci]"
git push
- name: Display CDN URL
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
echo "✅ Script updated and available via jsDelivr CDN:"
echo "📋 https://cdn.jsdelivr.net/gh/rfmarcelino/propsync@master/dist/propsync.js"