Build ES Bundle #14
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 ES Bundle | |
on: | |
workflow_dispatch | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
cache-dependency-path: ./material-web/package-lock.json | |
- uses: google/wireit@setup-github-actions-caching/v1 | |
- name: Build | |
run: | | |
cd ./material-web | |
npm ci | |
npm run build | |
env: | |
WIREIT_FAILURES: continue | |
- name: Bundle | |
run: | | |
cd ./material-web | |
npx esbuild --bundle --minify --format=esm --outfile=../dist/bundle.esm.min.js all.js | |
- name: Archive bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ESM Bundle | |
path: dist/bundle.esm.min.js | |
- name: Commit bundle | |
run: | | |
git config --global user.name "Luke Vo" | |
git config --global user.email "[email protected]" | |
git add ./dist/bundle.esm.min.js -f | |
git commit -m "Added built ESM bundle" | |
git push origin main | |