{"id":18996018,"url":"https://github.com/tomjschuster/cloudflare-pages-deploy-action","last_synced_at":"2025-04-22T13:48:56.150Z","repository":{"id":42379865,"uuid":"454644100","full_name":"tomjschuster/cloudflare-pages-deploy-action","owner":"tomjschuster","description":"GitHub Action for triggering and tracking a CloudFlare Pages deployment","archived":false,"fork":false,"pushed_at":"2022-11-04T00:01:25.000Z","size":1800,"stargazers_count":13,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T03:08:37.922Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomjschuster.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-02T04:36:58.000Z","updated_at":"2025-03-05T14:58:10.000Z","dependencies_parsed_at":"2023-01-04T15:32:27.151Z","dependency_job_id":null,"html_url":"https://github.com/tomjschuster/cloudflare-pages-deploy-action","commit_stats":{"total_commits":56,"total_committers":2,"mean_commits":28.0,"dds":0.0892857142857143,"last_synced_commit":"44103831307c09eab24d4a78af12865ade026626"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjschuster%2Fcloudflare-pages-deploy-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjschuster%2Fcloudflare-pages-deploy-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjschuster%2Fcloudflare-pages-deploy-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjschuster%2Fcloudflare-pages-deploy-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomjschuster","download_url":"https://codeload.github.com/tomjschuster/cloudflare-pages-deploy-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250252026,"owners_count":21399923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T17:33:39.660Z","updated_at":"2025-04-22T13:48:56.112Z","avatar_url":"https://github.com/tomjschuster.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tomjschuster/cloudflare-pages-deploy-action/actions/workflows/test.yml?query=branch%3Amain\"\u003e\u003cimg alt=\"typescript-action status\" src=\"https://github.com/tomjschuster/cloudflare-pages-deploy-action/workflows/build-test/badge.svg?branch=main\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/tomjschuster/cloudflare-pages-deploy-action?branch=main\"\u003e\u003cimg alt=\"Coverage Status\" src=\"https://coveralls.io/repos/github/tomjschuster/cloudflare-pages-deploy-action/badge.svg?branch=main\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Cloudflare Pages Deploy Action\n\nDeploys your [Cloudflare Pages](https://pages.cloudflare.com/) project, enabling you to integrate Pages into your existing CI pipeline using the following features:\n\n- Deploy your production branch or any other branch\n- Deploy preview environments for every pull request\n- Defer deployment until other stages/steps have passed (e.g. tests)\n- Perform actions after successful deployment (e.g. purge cache)\n- Track deployment status from within GitHub Actions\n- Create GitHub deployments for your Pages deployments\n\n![Cloudflare Page deploying from GitHub Actions](./assets/action-example.png)\n\n## Inputs\n\nBe sure to use a secure method such as [Encrypted Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) for storing/accessing Cloudflare API Key:\n\n| Name         |          | Description                                                                                                                                                                                                                                                                                                                            |\n| ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| account-id   | Required | Your Cloudflare account id. This is the id in the URL of Cloudflare's dashboard. You can also run the command `wrangler whoami` .                                                                                                                                                                                                      |\n| api-key      | yes      | Your [ Cloudflare Global API Key ](https://developers.cloudflare.com/api/keys#view-your-api-key) (Pages does not accept API tokens).                                                                                                                                                                                                   |\n| email        | yes      | The email associated with your Cloudflare account.                                                                                                                                                                                                                                                                                     |\n| project-name | yes      | The name of your Pages project.                                                                                                                                                                                                                                                                                                        |\n| branch       | no       | Triggers a Pages deployment for the provided branch. Cannot be set if `production` or `preview` are set. If neither `branch`, `production`, nor `preview` are set, the deployment branch will be determined from the workflow github context (raising an error if not triggered by a pull request).                                    |\n| production   | no       | If true, triggers a production Pages deployment. Cannot be set if `preview` or `branch` are set.                                                                                                                                                                                                                                       |\n| preview      | no       | If true, triggers a Pages deployment for the branch of the current pull request. Cannot be set if `production` or `branch` are set. Deployment branch will be derived from the workflow github context (raising an error if not triggered by a pull request).                                                                          |\n| github-token | no       | GitHub access token. If provided, triggers a GitHub deployment with the status of the Pages deployment. If using the Actions provided [`GITHUB_TOKEN`](https://docs.github.com/en/actions/security-guides/automatic-token-authentication), deployments will only work if the current repo is associated with the target Pages project. |\n\n## Outputs\n\n| Name           | Description                                                                                                                                            |\n| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| deployment-id  | Unique identifier of the deployment created by the action.                                                                                             |\n| deployment-url | Even though this action deploys the production branch, this will be the the build-specific pages URL (e.g. `https://a6975138.example-site.pages.dev`). |\n\n## Example\n\nDeploy your production environment:\n\n```yaml\nname: Deploy to production\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: tomjschuster/cloudflare-pages-deploy-action@v0\n        with:\n          account-id: '${{ env.CF_ACCOUNT_ID }}'\n          project-name: '${{ env.PAGES_PROJECT_NAME }}'\n          api-key: '${{ secrets.CF_GLOBAL_APIKEY }}'\n          email: '${{ secrets.CF_EMAIL }}'\n          production: true\n        env:\n          CF_ACCOUNT_ID: 752b6dba29604163bde5b5b90f042f62\n          PAGES_PROJECT_NAME: my-pages-project\n```\n\nDeploy preview environments for all pull requests:\n\n```yaml\nname: Deploy preview\n\non:\n  pull_request:\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: tomjschuster/cloudflare-pages-deploy-action@v0\n        with:\n          account-id: '${{ env.CF_ACCOUNT_ID }}'\n          project-name: '${{ env.PAGES_PROJECT_NAME }}'\n          api-key: '${{ secrets.CF_GLOBAL_APIKEY }}'\n          email: '${{ secrets.CF_EMAIL }}'\n          preview: true\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n        env:\n          CF_ACCOUNT_ID: 752b6dba29604163bde5b5b90f042f62\n          PAGES_PROJECT_NAME: my-pages-project\n```\n\nDeploy any branch\n\n```yaml\nname: Deploy to environments\n\non:\n  push:\n    branches:\n      - qa\n      - staging\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: tomjschuster/cloudflare-pages-deploy-action@v0\n        with:\n          account-id: '${{ env.CF_ACCOUNT_ID }}'\n          project-name: '${{ env.PAGES_PROJECT_NAME }}'\n          api-key: '${{ secrets.CF_GLOBAL_APIKEY }}'\n          email: '${{ secrets.CF_EMAIL }}'\n          branch: ${{ github.ref_name }}\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n        env:\n          CF_ACCOUNT_ID: 752b6dba29604163bde5b5b90f042f62\n          PAGES_PROJECT_NAME: my-pages-project\n```\n\nOr combine all deploys in a single job:\n\n```yaml\nname: CI\n\non:\n  push:\n    branches:\n      - main\n      - staging\n      - qa\n  pull_request:\n\n  env:\n    CF_ACCOUNT_ID: 752b6dba29604163bde5b5b90f042f62\n    PAGES_PROJECT_NAME: my-pages-project\n\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Deploy preview\n        if: ${{ github.event_name == 'pull_request' }}\n        uses: tomjschuster/cloudflare-pages-deploy-action@v0\n        with:\n          account-id: '${{ env.CF_ACCOUNT_ID }}'\n          project-name: '${{ env.PAGES_PROJECT_NAME }}'\n          api-key: '${{ secrets.CF_GLOBAL_APIKEY }}'\n          email: '${{ secrets.CF_EMAIL }}'\n          preview: true\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Deploy qa/staging\n        if: ${{ contains(fromJson('[\"refs/heads/qa\", \"refs/heads/staging\"]'), github.ref) \u0026\u0026 github.event_name == 'push' }}\n        uses: tomjschuster/cloudflare-pages-deploy-action@v0\n        with:\n          account-id: '${{ env.CF_ACCOUNT_ID }}'\n          project-name: '${{ env.PAGES_PROJECT_NAME }}'\n          api-key: '${{ secrets.CF_GLOBAL_APIKEY }}'\n          email: '${{ secrets.CF_EMAIL }}'\n          branch: ${{ github.ref_name }}\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Deploy production\n        if: ${{ github.ref == 'refs/heads/main' \u0026\u0026 github.event_name == 'push' }}\n        uses: tomjschuster/cloudflare-pages-deploy-action@v0\n        with:\n          account-id: '${{ env.CF_ACCOUNT_ID }}'\n          project-name: '${{ env.PAGES_PROJECT_NAME }}'\n          api-key: '${{ secrets.CF_GLOBAL_APIKEY }}'\n          email: '${{ secrets.CF_EMAIL }}'\n          production: true\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## License\n\nThe scripts and documentation in this project are released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomjschuster%2Fcloudflare-pages-deploy-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomjschuster%2Fcloudflare-pages-deploy-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomjschuster%2Fcloudflare-pages-deploy-action/lists"}