Go to file
2022-05-19 13:48:42 +01:00
.github Add Pages team as codeowners 2022-05-19 13:48:42 +01:00
.husky Initial commit 2022-05-10 11:10:48 +01:00
example Initial commit 2022-05-10 11:10:48 +01:00
src Initial commit 2022-05-10 11:10:48 +01:00
.gitignore Initial commit 2022-05-10 11:10:48 +01:00
action.yml Initial commit 2022-05-10 11:10:48 +01:00
index.js Initial commit 2022-05-10 11:10:48 +01:00
LICENSE Initial commit 2022-05-10 11:10:48 +01:00
package-lock.json Initial commit 2022-05-10 11:10:48 +01:00
package.json Initial commit 2022-05-10 11:10:48 +01:00
README.md Initial commit 2022-05-10 11:10:48 +01:00

Cloudflare Pages GitHub Action

GitHub Action for creating Cloudflare Pages deployments, using the new Direct Upload feature and Wrangler integration.

Usage

  1. Create an API token in the Cloudflare dashboard with the "Cloudflare Pages — Edit" permission.

  2. Add that API token as a secret to your GitHub repository, CLOUDFLARE_API_TOKEN.

  3. Create a .github/workflows/publish.yml file in your repository:

    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@1
            with:
              apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
              accountId: YOUR_ACCOUNT_ID
              projectName: YOUR_PROJECT_NAME
              directory: YOUR_ASSET_DIRECTORY
              gitHubToken: ${{ secrets.GITHUB_TOKEN }}
    
  4. Replace YOUR_ACCOUNT_ID, YOUR_PROJECT_NAME and YOUR_ASSET_DIRECTORY with the appropriate values to your Pages project.

More information can be found on our guide for making Direct Upload deployments with continous integration.