GitHub Actions: Build and verify bundle size
cgen-76c4aad2463c4342bd8e1ce33ead174a
This commit is contained in:
parent
a1160e3a99
commit
6715d8ddf4
1 changed files with 50 additions and 0 deletions
50
.github/workflows/build.yml
vendored
Normal file
50
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build client
|
||||
run: npm run build
|
||||
env:
|
||||
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
|
||||
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
|
||||
VITE_API_BASE: ${{ secrets.VITE_API_BASE }}
|
||||
VITE_DISCORD_CLIENT_ID: ${{ secrets.VITE_DISCORD_CLIENT_ID }}
|
||||
VITE_DEVCONNECT_URL: ${{ secrets.VITE_DEVCONNECT_URL }}
|
||||
VITE_DEVCONNECT_ANON_KEY: ${{ secrets.VITE_DEVCONNECT_ANON_KEY }}
|
||||
VITE_BUILDER_API_KEY: ${{ secrets.VITE_BUILDER_API_KEY }}
|
||||
|
||||
- name: Check bundle size
|
||||
run: |
|
||||
if [ -d "dist" ]; then
|
||||
echo "Build artifacts:"
|
||||
du -sh dist/
|
||||
find dist -type f -name "*.js" -o -name "*.css" | head -20
|
||||
fi
|
||||
|
||||
- name: Upload build artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
retention-days: 5
|
||||
Loading…
Reference in a new issue