diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml deleted file mode 100644 index d230ba4b2..000000000 --- a/.github/workflows/deploy-gh-pages.yml +++ /dev/null @@ -1,174 +0,0 @@ -name: Deploy to GitHub Pages - -permissions: - contents: read - pages: write - id-token: write - actions: read - -on: - # Trigger after successful CI workflows complete - workflow_run: - workflows: ["Storybook and Chromatic CI", "Vitest Tests", "Tests CI"] - types: [completed] - branches: [main] - # Allow direct pushes to the debug branch to kick off the full pipeline - push: - branches: [sno-deploy-ghpage] - # Keep manual trigger for debugging - workflow_dispatch: - -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - build: - runs-on: ubuntu-latest - # Only run if the triggering workflow succeeded (or manual dispatch/push) - if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' - steps: - - name: Checkout - uses: actions/checkout@v5 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10 - - - name: Setup Node.js - uses: actions/setup-node@v5 - with: - node-version: '24' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Storybook artifact from latest CI run - continue-on-error: true - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo "🔍 Downloading latest Storybook artifact..." - - # Get latest successful Storybook workflow run - LATEST_RUN=$(gh api "repos/${{ github.repository }}/actions/workflows" \ - --jq '.workflows[] | select(.name == "Storybook and Chromatic CI") | .id' | head -1) - - if [ -n "$LATEST_RUN" ]; then - RUN_ID=$(gh api "repos/${{ github.repository }}/actions/workflows/$LATEST_RUN/runs?status=success&branch=main" \ - --jq '.workflow_runs[0].id' 2>/dev/null || echo "") - - if [ -n "$RUN_ID" ] && [ "$RUN_ID" != "null" ]; then - # Download storybook-static artifact - ARTIFACT_ID=$(gh api "repos/${{ github.repository }}/actions/runs/$RUN_ID/artifacts" \ - --jq '.artifacts[] | select(.name == "storybook-static") | .id' | head -1) - - if [ -n "$ARTIFACT_ID" ]; then - gh api "repos/${{ github.repository }}/actions/artifacts/$ARTIFACT_ID/zip" > storybook-static.zip - unzip -q storybook-static.zip -d ./storybook-static - echo "✅ Downloaded and extracted Storybook artifact" - else - echo "⚠️ Storybook artifact not found, will build from source" - fi - else - echo "⚠️ No successful Storybook runs found, will build from source" - fi - else - echo "⚠️ Storybook workflow not found, will build from source" - fi - - - name: Download Vitest reports from latest CI run - continue-on-error: true - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo "🔍 Downloading latest Vitest reports..." - - # Get latest successful Vitest workflow run - LATEST_RUN=$(gh api "repos/${{ github.repository }}/actions/workflows" \ - --jq '.workflows[] | select(.name == "Vitest Tests") | .id' | head -1) - - if [ -n "$LATEST_RUN" ]; then - RUN_ID=$(gh api "repos/${{ github.repository }}/actions/workflows/$LATEST_RUN/runs?status=success&branch=main" \ - --jq '.workflow_runs[0].id' 2>/dev/null || echo "") - - if [ -n "$RUN_ID" ] && [ "$RUN_ID" != "null" ]; then - # Download vitest-reports artifact - ARTIFACT_ID=$(gh api "repos/${{ github.repository }}/actions/runs/$RUN_ID/artifacts" \ - --jq '.artifacts[] | select(.name == "vitest-reports") | .id' | head -1) - - if [ -n "$ARTIFACT_ID" ]; then - mkdir -p ./.gh-pages-cache - gh api "repos/${{ github.repository }}/actions/artifacts/$ARTIFACT_ID/zip" > vitest-reports.zip - unzip -q vitest-reports.zip -d ./.gh-pages-cache/vitest-reports - echo "✅ Downloaded and extracted Vitest reports" - else - echo "⚠️ Vitest reports not found, will generate from source" - fi - else - echo "⚠️ No successful Vitest runs found, will generate from source" - fi - else - echo "⚠️ Vitest workflow not found, will generate from source" - fi - - - name: Build static assets (with artifact reuse) - run: ./scripts/build-pages.sh - - - name: Setup Pages - uses: actions/configure-pages@v4 - - - name: Upload built pages as cache - uses: actions/upload-pages-artifact@v3 - with: - name: built-pages - path: './docs/pages' - - # deploy-for-sno-deploy-ghpage-branch: - # runs-on: ubuntu-latest - # needs: build - # if: github.ref == 'refs/heads/sno-deploy-ghpage' - # steps: - # - name: Debug deployment - # run: | - # echo "Contents of ./docs/pages:" - # ls -la ./docs/pages - # echo "Contents of ./docs/pages/vitest-reports (if exists):" - # ls -la ./docs/pages/vitest-reports || echo "No vitest-reports directory" - # echo "Preview URL: https://comfyorg-comfyui-frontend.vercel.app" - - deploy-github-pages: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 - - deploy-vercel-app: - runs-on: ubuntu-latest - needs: build - steps: - - name: Checkout code - uses: actions/checkout@v5 - - - name: download built pages - uses: actions/download-artifact@v3 - with: - name: built-pages - path: ./docs/pages - - - name: Deploy to Vercel - uses: amondnet/vercel-action@v20 - with: - vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required - vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} # Required - vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} # Required - working-directory: ./docs/pages - env: - VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Required for Vercel Action diff --git a/.github/workflows/release-pages.yml b/.github/workflows/release-pages.yml new file mode 100644 index 000000000..d7e73a457 --- /dev/null +++ b/.github/workflows/release-pages.yml @@ -0,0 +1,152 @@ +name: Deploy to GitHub Pages + +on: + # Triggers when any of these workflows complete on main branch + # Runs ONCE per workflow completion (e.g., if "Vitest Tests" completes, this workflow runs once) + workflow_run: + workflows: ['Storybook and Chromatic CI', 'Vitest Tests', 'Tests CI'] + types: [completed] + # Allow direct pushes to the debug branch to kick off the full pipeline + push: + branches: [sno-deploy-ghpage] + # Keep manual trigger for debugging + workflow_dispatch: + +jobs: + incremental-build: + runs-on: ubuntu-latest + # Only run if the triggering workflow succeeded (or manual dispatch/push) + if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Setup Node.js + uses: actions/setup-node@v5 + with: + node-version: '24' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Download Storybook artifact (source run) + id: fetch_storybook_trigger + continue-on-error: true + if: github.event_name == 'workflow_run' && github.event.workflow_run.name == 'Storybook and Chromatic CI' + uses: actions/download-artifact@v4 + with: + name: storybook-static + path: storybook-static + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Download Storybook artifact (latest successful run on main) + continue-on-error: true + if: steps.fetch_storybook_trigger.outcome != 'success' + uses: dawidd6/action-download-artifact@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: storybook-and-chromatic-ci.yaml + name: storybook-static + branch: main + workflow_conclusion: success + path: storybook-static + + - name: Download Vitest reports (source run) + id: fetch_vitest_trigger + continue-on-error: true + if: github.event_name == 'workflow_run' && github.event.workflow_run.name == 'Vitest Tests' + uses: actions/download-artifact@v4 + with: + name: vitest-reports + path: ./.pages + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Download Vitest reports (latest successful run on main) + continue-on-error: true + if: steps.fetch_vitest_trigger.outcome != 'success' + uses: dawidd6/action-download-artifact@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: vitest-tests.yaml + name: vitest-reports + branch: main + workflow_conclusion: success + path: ./.pages + + - name: Build static assets (with artifact reuse) + run: ./scripts/build-pages.sh + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload built pages as cache + uses: actions/upload-pages-artifact@v3 + with: + name: built-pages + path: './docs/pages' + + # deploy-for-sno-deploy-ghpage-branch: + # runs-on: ubuntu-latest + # needs: build + # if: github.ref == 'refs/heads/sno-deploy-ghpage' + # steps: + # - name: Debug deployment + # run: | + # echo "Contents of ./docs/pages:" + # ls -la ./docs/pages + # echo "Contents of ./docs/pages/vitest-reports (if exists):" + # ls -la ./docs/pages/vitest-reports || echo "No vitest-reports directory" + # echo "Preview URL: https://comfyorg-comfyui-frontend.vercel.app" + + incremental-deploy-github-pages: + permissions: + contents: read + pages: write + id-token: write + actions: read + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + needs: incremental-build + steps: + # - [Feature request: Partial upload/deploy · Issue #349 · actions/deploy-pages]( https://github.com/actions/deploy-pages/issues/349 ) + - name: Checkout code + uses: actions/checkout@v5 + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + + deploy-vercel-app: + runs-on: ubuntu-latest + needs: incremental-build + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: download built pages + uses: actions/download-artifact@v3 + with: + name: built-pages + path: ./docs/pages + + - name: Deploy to Vercel + uses: amondnet/vercel-action@v20 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required + vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} # Required + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} # Required + working-directory: ./docs/pages + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Required for Vercel Action diff --git a/.gitignore b/.gitignore index 227a878ee..b5ee9e104 100644 --- a/.gitignore +++ b/.gitignore @@ -78,7 +78,7 @@ templates_repo/ vite.config.mts.timestamp-*.mjs # Linux core dumps -./core +/core *storybook.log storybook-static @@ -93,14 +93,8 @@ storybook-static vite.config.*.timestamp* vitest.config.*.timestamp* -# Github Pages Build output -/pages-dist +# Generated reports in docs/pages (exclude generated, keep HTML templates) +/.pages/*/**/* +/.pages-dist/ -# Generated reports in docs/pages (exclude JSON data, keep HTML templates) -docs/pages/knip/report.json -docs/pages/vitest-ui/results.json -docs/pages/coverage/ -docs/pages/nx-graph/ -docs/pages/storybook/ -docs/pages/playwright-reports/ .vercel diff --git a/docs/pages/README.md b/.pages/README.md similarity index 100% rename from docs/pages/README.md rename to .pages/README.md diff --git a/docs/pages/index.html b/.pages/index.html similarity index 95% rename from docs/pages/index.html rename to .pages/index.html index e27c6bcc9..913bdef18 100644 --- a/docs/pages/index.html +++ b/.pages/index.html @@ -17,11 +17,7 @@ align-items: center; justify-content: center; padding: 2rem; - /* bg: gray + white lines net */ - background: #909090; - background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 2px, transparent 2px), radial-gradient(circle, rgba(255, 255, 255, 0.05) 2px, transparent 2px); - background-position: 0 0, 25px 25px; - background-size: 50px 50px; + background: linear-gradient(135deg, #667eea 0%, #52b2bb 100%); } .container { max-width: 1200px; diff --git a/.pages/knip.html b/.pages/knip.html new file mode 100644 index 000000000..cf0f3944b --- /dev/null +++ b/.pages/knip.html @@ -0,0 +1,80 @@ + + +
+ +