split cards #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Components | |
on: | |
push: | |
branches: | |
- '**' | |
paths: | |
- '.github/workflows/build-js.yaml' | |
- 'src/*.js' | |
- 'src/**/*.js' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: | | |
npm install terser -g | |
- name: Minify and merge JS files | |
run: | | |
npm run build | |
- name: Commit and push changes | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "github-actions@github.com" | |
git add dist/ha-public-transport-connection-card.js | |
if [[ $(git status --porcelain=v1 | wc -l) -ne 0 ]]; then | |
git commit -m "Auto-minify and merge JS files" | |
git push | |
fi |