<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/deploy-docc-documentation-to-cloudflare-pages-srg0gnkjg" -->

---
title: Deploy DocC documentation to Cloudflare Pages | daily.dev
description: A step-by-step guide walks through deploying Swift DocC documentation to Cloudflare Pages using GitHub Actions. It covers adding the swift-docc-plugin to...
canonical: https://daily.dev/posts/deploy-docc-documentation-to-cloudflare-pages-srg0gnkjg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Deploy DocC documentation to Cloudflare Pages | daily.dev
og:description: A step-by-step guide walks through deploying Swift DocC documentation to Cloudflare Pages using GitHub Actions. It covers adding the swift-docc-plugin to...
og:url: https://daily.dev/posts/deploy-docc-documentation-to-cloudflare-pages-srg0gnkjg
og:image: https://api.daily.dev/og/posts/SrG0gNKJg.png
og:image:alt: Deploy DocC documentation to Cloudflare Pages
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy DocC documentation to Cloudflare Pages

**[
      Tuist
    ](https://daily.dev/sources/tuist-blog)** · 4 min read · 0 upvotes · 0 comments

## Summary

A step-by-step guide walks through deploying Swift DocC documentation to Cloudflare Pages using GitHub Actions. It covers adding the swift-docc-plugin to Package.swift, generating documentation with the transform-for-static-hosting flag, using the new --enable-experimental-combined-documentation flag for multi-target packages, setting up a Cloudflare Pages project, and building a GitHub Actions pipeline with the Wrangler Action to automate builds and deployments on every push to main.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tuist.dev/blog/2025/02/10/deploy-docc-cloudflare-pages>

## Questions this post answers

### How do I generate combined DocC documentation for multiple Swift package targets?

Use the --enable-experimental-combined-documentation flag with swift package generate-documentation, passing multiple --target flags for each product. This creates a single documentation output where each target gets its own section. In Swift 6.1, this flag additionally generates an index page automatically, making it easier to host docs for packages with multiple products.

_Developers documenting multi-target Swift packages can find similar Swift tooling changes on daily.dev._

### How do I deploy DocC documentation to Cloudflare Pages automatically from GitHub Actions?

Set up a Cloudflare Pages project with automatic deployment disabled, then use the cloudflare/wrangler-action GitHub Action with a CLOUDFLARE_API_TOKEN secret. In the workflow, build the docs with swift package generate-documentation using --transform-for-static-hosting, then run 'pages deploy .build/documentation --project-name=your-project' via wrangler-action on every push to main.

_daily.dev helps developers automating documentation pipelines stay current on Swift and Cloudflare tooling._

### Should I use ubuntu-latest or macos-latest for building Swift DocC documentation in CI?

Use ubuntu-latest with the SwiftyLab/setup-swift action if the package builds on Linux, since it's cheaper and faster than macOS runners. If the package only builds on macOS, switch the runner to macos-latest and skip the Setup Swift step since Swift is preinstalled there.

_daily.dev surfaces practical CI configuration tips for developers building Swift packages._

## Similar posts on daily.dev

- [CI/CD for Cloudflare Pages using CircleCI and Wrangler](https://daily.dev/posts/ci-cd-for-cloudflare-pages-using-circleci-and-wrangler-zm1yqj3vf) · CircleCI · 0 upvotes · 0 comments
- [Deploying a PNPM Monorepo to Cloudflare Pages](https://daily.dev/posts/deploying-a-pnpm-monorepo-to-cloudflare-pages-vwrbbcc3c) · Nx · 0 upvotes · 0 comments
- [How to Deploy a Full-Stack Next.js App on Cloudflare Workers with GitHub Actions CI/CD](https://daily.dev/posts/how-to-deploy-a-full-stack-next-js-app-on-cloudflare-workers-with-github-actions-ci-cd-brfs1cbrn) · freeCodeCamp · 2 upvotes · 0 comments
- [foojay – Documentation as Code with AsciiDoctor, GitLab CI, and GitLab Pages](https://daily.dev/posts/foojay-documentation-as-code-with-asciidoctor-gitlab-ci-and-gitlab-pages-2fslmmcqk) · Foojay.io · 3 upvotes · 0 comments
- [How GitHub Copilot enables zero DNS configuration for GitHub Pages](https://daily.dev/posts/how-github-copilot-enables-zero-dns-configuration-for-github-pages-df2px9onj) · GitHub Blog · 1 upvotes · 0 comments

---

Tags: [#cicd](https://daily.dev/tags/cicd), [#swift](https://daily.dev/tags/swift), [#github-actions](https://daily.dev/tags/github-actions)

[View this post on daily.dev](https://daily.dev/posts/deploy-docc-documentation-to-cloudflare-pages-srg0gnkjg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Deploy DocC documentation to Cloudflare Pages","url":"https://daily.dev/posts/deploy-docc-documentation-to-cloudflare-pages-srg0gnkjg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/deploy-docc-documentation-to-cloudflare-pages-srg0gnkjg"},"datePublished":"2026-08-23T12:23:39.797Z","dateModified":"2026-08-23T12:56:57.115Z","description":"A step-by-step guide walks through deploying Swift DocC documentation to Cloudflare Pages using GitHub Actions. It covers adding the swift-docc-plugin to...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9f2b903bf862857057301f3c4ce14f36?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9f2b903bf862857057301f3c4ce14f36?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"\n      Tuist\n    ","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"\n      Tuist\n    ","logo":"https://media.daily.dev/image/upload/s--3AYDH23h--/f_auto,q_auto/v1787487506/logos/tuist-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/tuist-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/deploy-docc-documentation-to-cloudflare-pages-srg0gnkjg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cicd,swift,github-actions","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"\n      Tuist\n    ","item":"https://daily.dev/sources/tuist-blog"},{"@type":"ListItem","position":3,"name":"Deploy DocC documentation to Cloudflare Pages"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/deploy-docc-documentation-to-cloudflare-pages-srg0gnkjg#faq","mainEntity":[{"@type":"Question","name":"How do I generate combined DocC documentation for multiple Swift package targets?","acceptedAnswer":{"@type":"Answer","text":"Use the --enable-experimental-combined-documentation flag with swift package generate-documentation, passing multiple --target flags for each product. This creates a single documentation output where each target gets its own section. In Swift 6.1, this flag additionally generates an index page automatically, making it easier to host docs for packages with multiple products. Developers documenting multi-target Swift packages can find similar Swift tooling changes on daily.dev."}},{"@type":"Question","name":"How do I deploy DocC documentation to Cloudflare Pages automatically from GitHub Actions?","acceptedAnswer":{"@type":"Answer","text":"Set up a Cloudflare Pages project with automatic deployment disabled, then use the cloudflare/wrangler-action GitHub Action with a CLOUDFLARE_API_TOKEN secret. In the workflow, build the docs with swift package generate-documentation using --transform-for-static-hosting, then run 'pages deploy .build/documentation --project-name=your-project' via wrangler-action on every push to main. daily.dev helps developers automating documentation pipelines stay current on Swift and Cloudflare tooling."}},{"@type":"Question","name":"Should I use ubuntu-latest or macos-latest for building Swift DocC documentation in CI?","acceptedAnswer":{"@type":"Answer","text":"Use ubuntu-latest with the SwiftyLab/setup-swift action if the package builds on Linux, since it's cheaper and faster than macOS runners. If the package only builds on macOS, switch the runner to macos-latest and skip the Setup Swift step since Swift is preinstalled there. daily.dev surfaces practical CI configuration tips for developers building Swift packages."}}]}
```

