Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
6a67 committed Aug 28, 2024
1 parent 4e00bf5 commit 29ae3af
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/minify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Minify JavaScript

on:
push:
branches:
- main
paths:
- 'script.user.js'

jobs:
minify:
runs-on: ubuntu-latest

steps:
- name: Checkout main branch
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install UglifyJS
run: npm install uglify-js -g

- name: Minify JavaScript
run: |
uglifyjs script.user.js -o script.min.js -c -m
- name: Create/Update minified branch
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git checkout --orphan minified
git rm -rf .
mv script.min.js script.user.js
git add script.user.js
git commit -m "Update minified script"
git push origin minified --force
2 changes: 1 addition & 1 deletion script.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name JPDB Userscript (6a67)
// @namespace http://tampermonkey.net/
// @version 0.1.100
// @version 0.1.101
// @description Script for JPDB that adds some styling and functionality
// @match https://jpdb.io/*
// @grant GM_addStyle
Expand Down

0 comments on commit 29ae3af

Please sign in to comment.