chore: remove unused AI component (#1162) #339
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
| name: Build and Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }} - ${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'doocs/md' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Determine build command | |
| id: build-command | |
| run: | | |
| if [[ "${{ secrets.BUILD_COMMAND }}" == "build:h5-netlify" ]]; then | |
| echo "BUILD_COMMAND=build:h5-netlify" >> $GITHUB_ENV | |
| else | |
| echo "BUILD_COMMAND=build" >> $GITHUB_ENV | |
| fi | |
| - name: Run build | |
| run: pnpm web ${{ env.BUILD_COMMAND }} | |
| - name: Generate CNAME | |
| run: | | |
| mkdir -p apps/web/dist | |
| echo "md.doocs.org" > apps/web/dist/CNAME | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: apps/web/dist | |
| deploy-pages: | |
| needs: build | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github_pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| deploy-cloudflare: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'doocs/md' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build for Cloudflare Workers | |
| run: pnpm web build:h5-netlify | |
| env: | |
| CF_WORKERS: 1 | |
| - name: Deploy to Cloudflare Workers | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: deploy --name md | |
| workingDirectory: apps/web | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| - name: Deployment Summary | |
| run: | | |
| echo "🚀 Deployed to Cloudflare Workers!" | |
| echo "📍 URL: https://md.doocs.workers.dev" |