diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 85c207e2..fd0068e8 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,19 +2,22 @@ name: Deploy Docs on: push: + branches: + - main tags: - - v* + - "v*" jobs: deploy: name: "Deploy Docs" runs-on: ubuntu-latest environment: - name: ${{ github.ref == 'refs/heads/main' && 'production' || 'preview' }} + name: production url: ${{ steps.deploy.outputs.deployment-url }} + permissions: contents: read - id-token: write + defaults: run: working-directory: docs @@ -31,13 +34,18 @@ jobs: uses: actions/setup-node@v7 with: node-version: 24.19.0 - cache: 'pnpm' + cache: "pnpm" - name: Install dependencies - run: pnpm install + run: pnpm install --frozen-lockfile + + - name: Build docs + run: pnpm build - - name: Build & Deploy to NuxtHub - uses: nuxt-hub/action@v2 + - name: Deploy docs to Cloudflare + id: deploy + uses: cloudflare/wrangler-action@v3 with: - project-key: compodium-yt6s - directory: docs/ + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + workingDirectory: docs diff --git a/docs/nuxt.config.ts b/docs/nuxt.config.ts index cc8db0c6..6b26c5a4 100644 --- a/docs/nuxt.config.ts +++ b/docs/nuxt.config.ts @@ -31,6 +31,7 @@ export default defineNuxtConfig({ }, nitro: { + preset: 'cloudflare_module', prerender: { routes: [ '/' diff --git a/docs/wrangler.jsonc b/docs/wrangler.jsonc new file mode 100644 index 00000000..8a619ddd --- /dev/null +++ b/docs/wrangler.jsonc @@ -0,0 +1,11 @@ +{ + "$schema": "./node_modules/wrangler/config-schema.json", + "name": "compodium-docs", + "main": "./.output/server/index.mjs", + "assets": { + "directory": "./.output/public", + "binding": "ASSETS" + }, + "compatibility_date": "2025-09-01", + "compatibility_flags": ["nodejs_compat"] +}