### Cloudflare Pages Deployment GitHub Workflow Source: https://github.com/cloudflare/pages-action/blob/main/README.md Example GitHub Actions workflow to deploy a project to Cloudflare Pages using the `cloudflare/pages-action`. It requires checking out the repository, optionally building the project, and then publishing to Pages with specified account ID, project name, build output directory, and optionally a GitHub token and branch. ```yaml on: [push] jobs: publish: runs-on: ubuntu-latest permissions: contents: read deployments: write name: Publish to Cloudflare Pages steps: - name: Checkout uses: actions/checkout@v3 # Run a build step here if your project requires - name: Publish to Cloudflare Pages uses: cloudflare/pages-action@v1 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: YOUR_ACCOUNT_ID projectName: YOUR_PROJECT_NAME directory: YOUR_BUILD_OUTPUT_DIRECTORY # Optional: Enable this if you want to have GitHub Deployments triggered gitHubToken: ${{ secrets.GITHUB_TOKEN }} # Optional: Switch what branch you are publishing to. # By default this will be the branch which triggered this workflow branch: main # Optional: Change the working directory workingDirectory: my-site # Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta` wranglerVersion: '3' ``` -------------------------------- ### Publish to Cloudflare Pages using cloudflare/pages-action Source: https://github.com/cloudflare/pages-action/blob/main/README.md This snippet demonstrates how to configure the cloudflare/pages-action to publish a project to Cloudflare Pages. It includes essential parameters like API token, account ID, project name, build output directory, and the option to specify the Wrangler version. ```yaml - name: Publish to Cloudflare Pages uses: cloudflare/pages-action@v1 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: YOUR_ACCOUNT_ID projectName: YOUR_PROJECT_NAME directory: YOUR_BUILD_OUTPUT_DIRECTORY # Enable Wrangler v3 wranglerVersion: '3' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.