Skip to content

Build ES Bundle

Build ES Bundle #18

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