From 633b332700117c92222917d1311375896e04daef Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Wed, 26 Mar 2025 04:03:17 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=87=F0=9F=8F=BEci(docs):=20Deploy=20do?= =?UTF-8?q?cs=20to=20cloudflare=20(#217)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This deploys docs to cloudflare pages ## Related Issues ## Type of Change - [ ] Bug fix (non-breaking change) - [ ] New feature (non-breaking change) - [ ] Breaking change (fix or feature that changes existing functionality) - [ ] Documentation update - [ ] Other (please describe): ## Checklist - [ ] I have updated relevant documentation - [ ] My code follows the project's coding style - [ ] My changes generate no new warnings/errors ## Notes for Reviewers ## Screenshots/Demo ## Additional Context --- .github/workflows/docs.yml | 40 ++++++++++++++++++++++++++++++++++++++ .github/workflows/www.yml | 2 +- apps/docs/package.json | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..2c72abd0 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,40 @@ +name: Build docs + +on: + pull_request: + paths: + - "apps/docs/**" + - ".github/workflows/docs.yml" + push: + branches: [main] + paths: + - "apps/docs/**" + - ".github/workflows/docs.yml" + +jobs: + deploy-docs: + name: Build and deploy docs + runs-on: ubuntu-latest + defaults: + run: + working-directory: "apps/docs" + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + - name: Install dependencies + run: bun install + - name: Build Project Artifacts + run: bun run build + - name: Deploy Project Artifacts to Cloudflare + uses: cloudflare/wrangler-action@v3 + with: + packageManager: bun + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + wranglerVersion: "3.93.0" + workingDirectory: "apps/docs" + command: pages deploy ./dist --project-name=${{ vars.CF_DOCS_PAGES_PROJECT_NAME }} --commit-dirty=true + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/www.yml b/.github/workflows/www.yml index 1065fa06..6190e36b 100644 --- a/.github/workflows/www.yml +++ b/.github/workflows/www.yml @@ -12,7 +12,7 @@ on: - ".github/workflows/www.yml" jobs: - deploy-www-pr: + deploy-www: name: Build and deploy www runs-on: ubuntu-latest defaults: diff --git a/apps/docs/package.json b/apps/docs/package.json index 891d56fe..d47b567d 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "nestri.dev": "nuxi dev", - "build": "nuxi build", + "build": "nuxi build --preset=cloudflare_pages", "generate": "nuxi generate", "preview": "nuxi preview", "lint": "eslint ."