From 4b50a3991ac53e5314b5ea4a20366af0f698656b Mon Sep 17 00:00:00 2001 From: snomiao Date: Tue, 14 Oct 2025 04:54:06 +0000 Subject: [PATCH] ci: enable pages pipeline on sno-deploy-ghpage debugging --- .github/workflows/deploy-gh-pages.yml | 63 +++++++++++++------ .../workflows/storybook-and-chromatic-ci.yaml | 4 +- .github/workflows/tests-ci.yaml | 2 +- .github/workflows/vitest-tests.yaml | 10 +-- .gitignore | 1 + 5 files changed, 55 insertions(+), 25 deletions(-) diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index 810a2c747..739da6f60 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -12,6 +12,9 @@ on: 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: @@ -22,8 +25,8 @@ concurrency: jobs: build: runs-on: ubuntu-latest - # Only run if the triggering workflow succeeded (or manual dispatch) - if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' + # 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 @@ -112,30 +115,31 @@ jobs: fi - name: Build static assets (with artifact reuse) - run: ./scripts/build-gh-pages.sh + run: ./scripts/build-pages.sh - name: Setup Pages uses: actions/configure-pages@v4 - - name: Upload artifact + - 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: + # 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 }} @@ -145,3 +149,26 @@ jobs: - 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/storybook-and-chromatic-ci.yaml b/.github/workflows/storybook-and-chromatic-ci.yaml index 707ac5371..b29ee3623 100644 --- a/.github/workflows/storybook-and-chromatic-ci.yaml +++ b/.github/workflows/storybook-and-chromatic-ci.yaml @@ -6,6 +6,8 @@ on: workflow_dispatch: # Allow manual triggering pull_request: branches: [main, sno-deploy-ghpage] + push: + branches: [sno-deploy-ghpage] jobs: # Post starting comment for non-forked PRs @@ -32,7 +34,7 @@ jobs: # Build Storybook for all PRs (free Cloudflare deployment) storybook-build: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' || github.event_name == 'push' outputs: conclusion: ${{ steps.job-status.outputs.conclusion }} workflow-url: ${{ steps.workflow-url.outputs.url }} diff --git a/.github/workflows/tests-ci.yaml b/.github/workflows/tests-ci.yaml index 0d33ecf19..0730cdaa1 100644 --- a/.github/workflows/tests-ci.yaml +++ b/.github/workflows/tests-ci.yaml @@ -2,7 +2,7 @@ name: Tests CI on: push: - branches: [main, master, core/*, desktop/*] + branches: [main, master, core/*, desktop/*, sno-deploy-ghpage] pull_request: branches-ignore: [wip/*, draft/*, temp/*, vue-nodes-migration, sno-playwright-*] diff --git a/.github/workflows/vitest-tests.yaml b/.github/workflows/vitest-tests.yaml index 03a641d53..3695670cf 100644 --- a/.github/workflows/vitest-tests.yaml +++ b/.github/workflows/vitest-tests.yaml @@ -2,7 +2,7 @@ name: Vitest Tests on: push: - branches: [main, master, dev*, core/*, desktop/*] + branches: [main, master, dev*, core/*, desktop/*, sno-deploy-ghpage] pull_request: branches-ignore: [wip/*, draft/*, temp/*] @@ -47,8 +47,8 @@ jobs: - name: Run Vitest tests run: pnpm test:unit - - name: Generate test reports (on main branch) - if: github.ref == 'refs/heads/main' + - name: Generate test reports (on main or debug branch) + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/sno-deploy-ghpage' run: | mkdir -p ./vitest-reports pnpm exec vitest \ @@ -56,8 +56,8 @@ jobs: --reporter=html --outputFile.html="./vitest-reports/index.html" \ --run - - name: Upload Vitest reports artifact (on main branch) - if: github.ref == 'refs/heads/main' + - name: Upload Vitest reports artifact (on main or debug branch) + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/sno-deploy-ghpage' uses: actions/upload-artifact@v4 with: name: vitest-reports diff --git a/.gitignore b/.gitignore index d99406b0c..227a878ee 100644 --- a/.gitignore +++ b/.gitignore @@ -103,3 +103,4 @@ docs/pages/coverage/ docs/pages/nx-graph/ docs/pages/storybook/ docs/pages/playwright-reports/ +.vercel