Merge pull request #10 from makermelissa/main #7
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 Distribution Files | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
# Only run the build on Adafruit's repository. It makes the PRs less messy. | |
if: startswith(github.repository, 'adafruit/') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Create dist Folder | |
run: "mkdir -p dist" | |
- name: Remove existing dist files | |
run: "rm -f dist/*" | |
- name: Copy files to dist folder | |
run: "cp *.{js,py,json} dist/" | |
- name: Minify JavaScript | |
uses: nizarmah/[email protected] | |
with: | |
directory: 'dist' | |
js_engine: 'uglify-js' | |
- name: Update Minified Dependencies | |
run: "sed -i 's/base_installer\\.js/base_installer.min.js/g' dist/*.min.js" | |
- name: Commit Distribution Files | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
repository: 'dist' | |
commit_message: "Github Action: Updated dist files" | |
branch: ${{ github.ref }} |