chore(deps): bump @types/node from 25.9.3 to 26.0.0 #590
Workflow file for this run
This file contains hidden or 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
| # ============================================================================= | |
| # PyExplorer - GitHub Actions CI/CD Pipeline | |
| # ============================================================================= | |
| # Este workflow realiza: | |
| # - CI: Build, Lint, Type-check em PRs e pushes | |
| # - CD: Deploy automático para Firebase Hosting na branch main | |
| # ============================================================================= | |
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| env: | |
| NODE_VERSION: '22' | |
| FIREBASE_PROJECT_ID: pyexplorer-cd32d | |
| permissions: | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| # =========================================================================== | |
| # JOB: Build & Lint | |
| # =========================================================================== | |
| build: | |
| name: 🔨 Build & Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: 📦 Setup Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: 🌐 Install system dependencies for Puppeteer | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libgbm-dev \ | |
| libnss3 \ | |
| libatk-bridge2.0-0 \ | |
| libgtk-3-0 \ | |
| libasound2t64 \ | |
| libasound2 \ | |
| libxss1 \ | |
| libxtst6 \ | |
| libxshmfence1 \ | |
| libglu1-mesa || true # Ignora erros se algum pacote não existir na versão do Ubuntu | |
| - name: 📥 Install dependencies | |
| run: npm ci | |
| - name: 🔍 Type check (TypeScript) | |
| run: npx tsc --noEmit | |
| - name: 🧹 Lint check | |
| run: npm run lint || true | |
| - name: 🔨 Build production | |
| timeout-minutes: 10 | |
| run: npm run build | |
| env: | |
| VITE_FIREBASE_API_KEY: ${{ secrets.VITE_FIREBASE_API_KEY }} | |
| VITE_FIREBASE_AUTH_DOMAIN: ${{ secrets.VITE_FIREBASE_AUTH_DOMAIN }} | |
| VITE_FIREBASE_PROJECT_ID: ${{ secrets.VITE_FIREBASE_PROJECT_ID }} | |
| VITE_FIREBASE_STORAGE_BUCKET: ${{ secrets.VITE_FIREBASE_STORAGE_BUCKET }} | |
| VITE_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.VITE_FIREBASE_MESSAGING_SENDER_ID }} | |
| VITE_FIREBASE_APP_ID: ${{ secrets.VITE_FIREBASE_APP_ID }} | |
| VITE_FIREBASE_MEASUREMENT_ID: ${{ secrets.VITE_FIREBASE_MEASUREMENT_ID }} | |
| VITE_RECAPTCHA_SITE_KEY: ${{ secrets.VITE_RECAPTCHA_SITE_KEY }} | |
| - name: 📊 Report bundle size | |
| run: | | |
| echo "## 📦 Bundle Size Report" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| File | Size |" >> $GITHUB_STEP_SUMMARY | |
| echo "|------|------|" >> $GITHUB_STEP_SUMMARY | |
| for file in dist/assets/*.js dist/assets/*.css; do | |
| if [ -f "$file" ]; then | |
| size=$(du -h "$file" | cut -f1) | |
| echo "| $(basename $file) | $size |" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| done | |
| - name: 📤 Upload build artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: dist/ | |
| retention-days: 7 | |
| # =========================================================================== | |
| # JOB: Deploy to Firebase (Production) | |
| # =========================================================================== | |
| deploy-production: | |
| name: 🚀 Deploy to Production | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| # Só faz deploy em push para main (não em PRs) | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| environment: | |
| name: production | |
| url: https://pyexplorer.com.br | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: 📥 Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: 🔥 Deploy to Firebase Hosting | |
| uses: FirebaseExtended/action-hosting-deploy@v0 | |
| with: | |
| repoToken: ${{ secrets.GITHUB_TOKEN }} | |
| firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_PYEXPLORER_CD32D }} | |
| projectId: ${{ env.FIREBASE_PROJECT_ID }} | |
| channelId: live | |
| env: | |
| FIREBASE_CLI_EXPERIMENTS: webframeworks | |
| - name: ✅ Deploy Summary | |
| run: | | |
| echo "## 🚀 Deployment Successful!" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Environment:** Production" >> $GITHUB_STEP_SUMMARY | |
| echo "**URL:** https://pyexplorer.com.br" >> $GITHUB_STEP_SUMMARY | |
| echo "**Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY | |
| echo "**Deployed at:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_STEP_SUMMARY | |
| # =========================================================================== | |
| # JOB: Preview Deploy (Pull Requests) | |
| # =========================================================================== | |
| deploy-preview: | |
| name: 👀 Deploy Preview | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| # Só faz preview em PRs (exceto Dependabot que não tem acesso aos secrets) | |
| if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: 📥 Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: 🔥 Deploy Preview to Firebase Hosting | |
| uses: FirebaseExtended/action-hosting-deploy@v0 | |
| with: | |
| repoToken: ${{ secrets.GITHUB_TOKEN }} | |
| firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_PYEXPLORER_CD32D }} | |
| projectId: ${{ env.FIREBASE_PROJECT_ID }} | |
| env: | |
| FIREBASE_CLI_EXPERIMENTS: webframeworks | |
| # =========================================================================== | |
| # JOB: Lighthouse Audit (Performance) | |
| # =========================================================================== | |
| lighthouse: | |
| name: 🔦 Lighthouse Audit | |
| runs-on: ubuntu-24.04 | |
| needs: deploy-production | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: 🔦 Run Lighthouse | |
| uses: treosh/lighthouse-ci-action@v12 | |
| with: | |
| urls: | | |
| https://pyexplorer.com.br/ | |
| https://pyexplorer.com.br/game | |
| uploadArtifacts: true | |
| temporaryPublicStorage: true | |
| - name: 📊 Lighthouse Score Summary | |
| if: always() | |
| run: | | |
| echo "## 🔦 Lighthouse Audit Complete" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Check the artifacts for detailed reports." >> $GITHUB_STEP_SUMMARY |