{"id":21898318,"url":"https://github.com/aetherinox/cloudflare-publish-action","last_synced_at":"2025-04-15T18:32:57.615Z","repository":{"id":237693130,"uuid":"795056570","full_name":"Aetherinox/cloudflare-publish-action","owner":"Aetherinox","description":"Github action for publishing to Cloudflare pages.","archived":false,"fork":false,"pushed_at":"2024-11-13T01:08:47.000Z","size":658,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T13:03:00.581Z","etag":null,"topics":["actions","cloudflare","cloudflare-pages"],"latest_commit_sha":null,"homepage":"https://cloudflare-publish-action.pages.dev/","language":"JavaScript","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/Aetherinox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://buymeacoffee.com/aetherinox"],"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null}},"created_at":"2024-05-02T13:52:53.000Z","updated_at":"2024-11-19T03:52:11.000Z","dependencies_parsed_at":"2024-05-03T02:44:08.504Z","dependency_job_id":"892349f4-b027-4d35-abdc-140c1f3767dc","html_url":"https://github.com/Aetherinox/cloudflare-publish-action","commit_stats":null,"previous_names":["aetherinox/cloudflare-publish-action","aetherinox/cloudflare-pages-action","aetherinaux/cloudflare-publish-action"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aetherinox%2Fcloudflare-publish-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aetherinox%2Fcloudflare-publish-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aetherinox%2Fcloudflare-publish-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aetherinox%2Fcloudflare-publish-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aetherinox","download_url":"https://codeload.github.com/Aetherinox/cloudflare-publish-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129357,"owners_count":21217341,"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":["actions","cloudflare","cloudflare-pages"],"created_at":"2024-11-28T14:25:46.728Z","updated_at":"2025-04-15T18:32:57.582Z","avatar_url":"https://github.com/Aetherinox.png","language":"JavaScript","funding_links":["https://buymeacoffee.com/aetherinox"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eCloudflare Pages ☁️ Github Action\u003c/h1\u003e\n\u003cbr /\u003e\n\u003cp\u003e\n\nA forked copy of the Github action [Cloudflare Pages](https://github.com/cloudflare/pages-action) which is updated to utilize NodeJS 20+ and continues updates.\n\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\u003c!-- prettier-ignore-start --\u003e\n[![Test Status][badge-tests]][link-tests]\n[![Last Commit][badge-commit]][badge-commit]\n[![Size][badge-size-gh]][badge-size-gh]\n[![All Contributors][badge-all-contributors]](#contributors-)\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c/div\u003e\n\n---\n\n\u003cbr /\u003e\n\n- [About](#about)\n- [Usage](#usage)\n  - [Get Account ID](#get-account-id)\n  - [Generate an API Token](#generate-an-api-token)\n  - [Define Branch](#define-branch)\n  - [Define Working Directory](#define-working-directory)\n  - [Wrangler v3](#wrangler-v3)\n- [Outputs](#outputs)\n- [Examples](#examples)\n- [Contributors ✨](#contributors-)\n\n\n\u003c/div\u003e\n\n---\n\n\u003cbr /\u003e\n\n## About\nGitHub Action for creating Cloudflare Pages deployments, using the [Direct Upload](https://developers.cloudflare.com/pages/platform/direct-upload/) feature and [Wrangler](https://developers.cloudflare.com/pages/platform/direct-upload/#wrangler-cli) integration.\n\n\u003cbr /\u003e\n\nThis action was originally found on the official Cloudflare Github page, but the action has lacked updates to more recent libraries.\n\n\u003cbr /\u003e\n\nSpecifying `wranglerVersion: '3'` will utilize the newer `wrangler deploy` command over v2's deprecated `publish` command. \n\n\u003cbr /\u003e\n\n---\n\n\u003cbr /\u003e\n\n## Usage\n\n1. Create an API token within the [Cloudflare Dashboard](https://dash.cloudflare.com/profile/api-tokens) with the \"Cloudflare Pages — Edit\" permission.\n2. Within the example below, replace `CLOUDFLARE_API_TOKEN` with your given API token.\n3. Create a new Github action file `.github/workflows/cfpage-publish.yml` in your repository with the following:\n\n\u003cbr /\u003e\n\n```yml\nrun-name: \"☁️ CF › Deploy\"\nname: \"☁️ CF › Deploy\"\n\non: [push]\n\njobs:\n  job-publish:\n      name: \u003e-\n        📦 Publish to Cloudflare\n      runs-on: ubuntu-latest\n      permissions:\n          contents: read\n          deployments: write\n      steps:\n\n        - name: \"☑️ Checkout\"\n          id: task_publish_checkout\n          uses: actions/checkout@v4\n\n        - name: \"☁️ Publish to Cloudflare Pages\"\n          id: task_publish_push\n          uses: aetherinox/cloudflare-publish-action@latest\n          with:\n              apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}       # Cloudflare API Token at https://dash.cloudflare.com/profile/api-tokens\n              accountId: ACCOUNT_ID                               # Cloudflare account ID available on right side of CF website\n              projectName: PROJECT_NAME                           # Project name assigned at creation. view on workers-and-pages section of CF website\n              directory: BUILD_OUTPUT_FOLDER                      # Output directory for built website\n              gitHubToken: ${{ secrets.GITHUB_TOKEN }}            # Optional: Enable this if you want to have GitHub Deployments triggered\n              branch: main                                        # Branch website published to; by default this will be the branch which triggered this workflow\n              workingDirectory: my-site                           # Working directory\n              wranglerVersion: '3'                                # Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`\n              commitMsg: 'Your commit message'                    # Optional: Commit message to attach\n              commitDirty: false                                  # Optional: Whether or not the workspace should be considered dirty for this deployment\n              skipCaching: false                                  # Optional: Skip asset caching which speeds up builds\n```\n\n\u003cbr /\u003e\n\nReplace with following variables with your own:\n- `ACCOUNT_ID`\n- `PROJECT_NAME`\n- `BUILD_OUTPUT_FOLDER`\n\n\u003cbr /\u003e\n\n### Get Account ID\n\nTo find your account ID, log in to the [Cloudflare Dashboard](https://dash.cloudflare.com/) \u003e select your zone in Account Home \u003e find your account ID in Overview under **API** on the right-side menu. If you have not added a zone, add one by selecting **Add site** . You can purchase a domain from [Cloudflare’s registrar](https://developers.cloudflare.com/registrar/).\n\nIf you do not have a zone registered to your account, you can also get your account ID from the `pages.dev` URL. E.g: `https://dash.cloudflare.com/\u003cACCOUNT_ID\u003e/pages`\n\n\u003cbr /\u003e\n\n### Generate an API Token\n\nTo generate an API token:\n\n1. Log in to the [Cloudflare Dashboard](https://dash.cloudflare.com/)\n2. Select [My Profile](https://dash.cloudflare.com/profile) from the dropdown menu of your user icon on the top right of your dashboard.\n3. Select [API Tokens](https://dash.cloudflare.com/profile/api-tokens) \u003e `Create Token`\n4. Under `Custom Token`, select `Get Started`\n5. Name your API Token in the Token name field\n6. Under `Permissions`, select `Account`, `Cloudflare Pages` and `Edit`\n7. Select Continue to `Summary` \u003e `Create Token`\n\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg style=\"width: 75%;text-align: center;border: 1px solid #353535;\" src=\"https://github.com/Aetherinox/cloudflare-publish-action/assets/118329232/1848a758-63e5-4cd1-8c7e-9ae16c62355a\"\u003e\u003c/p\u003e\n\n\u003cbr /\u003e\n\nMore information can be found on [our guide for making Direct Upload deployments with continous integration](https://developers.cloudflare.com/pages/how-to/use-direct-upload-with-continuous-integration/#use-github-actions).\n\n\u003cbr /\u003e\n\n### Define Branch\n\nThe branch name is used by Cloudflare Pages to determine if the deployment is production or preview. Read more about\n[git branch build controls](https://developers.cloudflare.com/pages/platform/branch-build-controls/#branch-build-controls).\n\nIf you are in a Git workspace, Wrangler will automatically pull the branch information for you. You can override this\nmanually by adding the argument `branch: BRANCH_NAME`.\n\n\u003cbr /\u003e\n\n### Define Working Directory\n\nBy default Wrangler will run in the root package directory. If your app lives in a monorepo and you want to run Wrangler from its directory, add `workingDirectory: PACKAGE_DIRECTORY`.\n\n\u003cbr /\u003e\n\nSome people may store their website in the root directory of a branch; if so, specify `./` as your working directory.\n\n\u003cbr /\u003e\n\n### Wrangler v3\n\nYou can use the newly released [Wrangler v3](https://blog.cloudflare.com/wrangler3/) with the `wranglerVersion` property.\n\n```yaml\n- name: \"☁️ Publish to Cloudflare Pages\"\n  uses: aetherinox/cloudflare-publish-action@latest\n  with:\n    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n    accountId: ACCOUNT_ID\n    projectName: PROJECT_NAME\n    directory: BUILD_OUTPUT_FOLDER\n    wranglerVersion: '3'\n```\n\n\u003cbr /\u003e\n\n---\n\n\u003cbr /\u003e\n\n## Outputs\nThis action will return the following outputs:\n\n\u003cbr /\u003e\n\n| Name          | Description                                         |\n| ------------- | --------------------------------------------------- |\n| `id`          | The ID of the pages deployment                      |\n| `url`         | The URL of the pages deployment                     |\n| `alias`       | The alias if it exists otherwise the deployment URL |\n| `environment` | The environment that was deployed to                |\n\n\u003cbr /\u003e\n\n---\n\n\u003cbr /\u003e\n\n## Examples\nA few examples of this Github action are provided below:\n\n\u003cdetails\u003e\u003csummary\u003eDeploy cloudflare pages on push with deploy outputs\u003c/summary\u003e\n\n\u003cbr /\u003e\n\nThis example allows you to run the action either manually, or on push for the branches `master` or `main`. It includes input declarations when using `workflow_dispatch`.\n\n\u003cbr /\u003e\n\n```yml\nrun-name: \"☁️ CF › Deploy\"\nname: \"☁️ CF › Deploy\"\n\non:\n  push:\n    branches:\n      - main\n      - master\n\njobs:\n  job-publish:\n      name: \u003e-\n        📦 Publish to Cloudflare\n      runs-on: ubuntu-latest\n      permissions:\n          contents: read\n          deployments: write\n      steps:\n\n        - name: \"☑️ Checkout\"\n          id: task_publish_checkout\n          uses: actions/checkout@v4\n\n        - name: \"☁️ Publish to Cloudflare Pages\"\n          id: task_publish_push\n          uses: aetherinox/cloudflare-publish-action@latest\n          with:\n              apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n              accountId: ACCOUNT_ID\n              projectName: PROJECT_NAME\n              directory: BUILD_OUTPUT_FOLDER\n              gitHubToken: ${{ secrets.GITHUB_TOKEN }}\n              branch: main\n              workingDirectory: my-site\n              wranglerVersion: '3'\n\n        - name: \"📝 Outputs\"\n          run: |\n            echo \"ID ........... ${{ steps.task_publish_push.outputs.id }}\"\n            echo \"URL .......... ${{ steps.task_publish_push.outputs.url }}\"\n            echo \"Environment .. ${{ steps.task_publish_push.outputs.environment }}\"\n            echo \"Alias ........ ${{ steps.task_publish_push.outputs.alias }}\"\n\n        - name: \"📝 Outputs to Summary\"\n          run: |\n              echo \"Deployed to ${{ steps.task_publish_push.outputs.url }}\" \u003e\u003e $GITHUB_STEP_SUMMARY\n```\n\n\u003cbr /\u003e\n\nEnsure you change the values above to your own.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eRun npm, @cloudflare/next-on-pages (Next.js), and deploy to cloudflare pages\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n[@cloudflare/next-on-pages](https://github.com/cloudflare/next-on-pages) is a CLI tool that you can use to build and develop Next.js applications so that they can run on the Cloudflare Pages platform.\n\n\u003cbr /\u003e\n\n```yml\nrun-name: \"☁️ CF › Deploy\"\nname: \"☁️ CF › Deploy\"\n\non:\n  push:\n    branches:\n      - main\n      - master\n\njobs:\n  job-publish:\n      name: \u003e-\n        📦 Publish to Cloudflare\n      runs-on: ubuntu-latest\n      permissions:\n          contents: read\n          deployments: write\n          statuses: write\n      steps:\n\n        - name: \"☑️ Checkout\"\n          id: task_publish_checkout\n          uses: actions/checkout@v4\n\n        - name: \"📦 Install Packages\"\n          id: task_publish_install_packages\n          run: npm install\n\n        - name: \"🔨 Build\"\n          id: task_publish_build_nextonpages\n          run: npx @cloudflare/next-on-pages@1\n\n        - name: \"☁️ Publish to Cloudflare Pages\"\n          id: task_publish_push\n          uses: aetherinox/cloudflare-publish-action@latest\n          with:\n              apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n              accountId: ACCOUNT_ID\n              projectName: PROJECT_NAME\n              directory: BUILD_OUTPUT_FOLDER\n              gitHubToken: ${{ secrets.GITHUB_TOKEN }}\n              branch: main\n              workingDirectory: my-site\n              wranglerVersion: '3'\n\n        - name: \"📝 Outputs\"\n          run: |\n            echo \"ID ........... ${{ steps.task_publish_push.outputs.id }}\"\n            echo \"URL .......... ${{ steps.task_publish_push.outputs.url }}\"\n            echo \"Environment .. ${{ steps.task_publish_push.outputs.environment }}\"\n            echo \"Alias ........ ${{ steps.task_publish_push.outputs.alias }}\"\n\n        - name: \"📝 Outputs to Summary\"\n          run: |\n              echo \"Deployed to ${{ steps.task_publish_push.outputs.url }}\" \u003e\u003e $GITHUB_STEP_SUMMARY\n```\n\n\u003cbr /\u003e\n\nEnsure you change the values above to your own.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eRun on push + workflow dispatch (with inputs)\u003c/summary\u003e\n\n\u003cbr /\u003e\n\nThis example allows you to run the action either manually, or on push for the branches `master` or `main`. It includes input declarations when using `workflow_dispatch`.\n\n\u003cbr /\u003e\n\n```yml\nrun-name: \"☁️ CF › Deploy\"\nname: \"☁️ CF › Deploy\"\n\non:\n  push:\n    branches:\n      - main\n      - master\n\n  workflow_dispatch:\n    inputs:\n      PROJECT_NAME:\n        description:  \"Project Name\"\n        required:     true\n        default:      'my-site'\n        type:         string\n\n      CLOUDFLARE_ACCOUNT_ID:\n        description:  \"Cloudflare Account ID\"\n        required:     true\n        default:      'XXXXXXXXXXXXXXXX'\n        type:         string\n\n      DIRECTORY_BUILD_OUTPUT:\n        description:  \"Build Output Dir\"\n        required:     true\n        default:      './'\n        type:         string\n\n      DIRECTORY_WORKING:\n        description:  \"Working Dir\"\n        required:     true\n        default:      './'\n        type:         string\n\n      WRANGLER_VERSION:\n        description:  \"Wrangler Version\"\n        required:     true\n        default:      '3'\n        type:         string\n\n      BRANCH:\n        description:  'Website Branch'\n        required:     true\n        default:      'main'\n        type:         choice\n        options:\n        - main\n        - master\n\njobs:\n  job-publish:\n      name: \u003e-\n        📦 Publish to Cloudflare\n      runs-on: ubuntu-latest\n      permissions:\n          contents: read\n          deployments: write\n      steps:\n\n        - name: \"☑️ Checkout\"\n          id: task_publish_checkout\n          uses: actions/checkout@v4\n\n        - name: \"☁️ Publish to Cloudflare Pages\"\n          id: task_publish_push\n          uses: aetherinox/cloudflare-publish-action@latest\n          with:\n              apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n              accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID || inputs.CLOUDFLARE_ACCOUNT_ID }}\n              projectName: ${{ inputs.PROJECT_NAME || 'my-site' }}\n              directory: ${{ inputs.DIRECTORY_BUILD_OUTPUT || './' }}\n              gitHubToken: ${{ secrets.GITHUB_TOKEN }}\n              branch: ${{ inputs.BRANCH || 'main' }}\n              workingDirectory: ${{ inputs.DIRECTORY_WORKING || './' }}\n              wranglerVersion: ${{ inputs.WRANGLER_VERSION || '3' }}\n```\n\n\u003cbr /\u003e\n\nEnsure you change the values above to your own.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eVerify \u0026 create project using Cloudflare APU, then push to cloudflare (with inputs)\u003c/summary\u003e\n\n\u003cbr /\u003e\n\nThis example adds the usage of the Cloudflare api to first check if your project name actually exists on Cloudflare, creates the project if not, and then pushes to Cloudflare pages.\n\n\u003cbr /\u003e\n\n```yml\nrun-name: \"☁️ CF › Deploy\"\nname: \"☁️ CF › Deploy\"\n\non:\n  push:\n    branches:\n      - main\n      - master\n\n  workflow_dispatch:\n    inputs:\n      PROJECT_NAME:\n        description:  \"Project Name\"\n        required:     true\n        default:      'my-site'\n        type:         string\n\n      CLOUDFLARE_ACCOUNT_ID:\n        description:  \"Cloudflare Account ID\"\n        required:     true\n        default:      'XXXXXXXXXXXXXXXX'\n        type:         string\n\n      DIRECTORY_BUILD_OUTPUT:\n        description:  \"Build Output Dir\"\n        required:     true\n        default:      './'\n        type:         string\n\n      DIRECTORY_WORKING:\n        description:  \"Working Dir\"\n        required:     true\n        default:      './'\n        type:         string\n\n      WRANGLER_VERSION:\n        description:  \"Wrangler Version\"\n        required:     true\n        default:      '3'\n        type:         string\n\n      BRANCH:\n        description:  'Website Branch'\n        required:     true\n        default:      'main'\n        type:         choice\n        options:\n        - main\n        - master\n\njobs:\n  job-publish:\n      name: \u003e-\n        📦 Publish to Cloudflare\n      runs-on: ubuntu-latest\n      permissions:\n          contents: read\n          deployments: write\n      steps:\n\n        - name: \"☑️ Checkout\"\n          id: task_publish_checkout\n          uses: actions/checkout@v4\n\n        - name: \"☁️ CF › Check Project\"\n          id: task_publish_project_verify\n          shell: bash\n          run: |\n            check=$(curl -s -X GET \"https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID || inputs.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/${{ inputs.PROJECT_NAME || 'my-site' }}\" \\\n              -H \"Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}\" \\\n              -H \"Content-Type:application/json\" | jq -r '.success')\n            echo \"result=$check\" \u003e\u003e $GITHUB_OUTPUT\n\n        - name: \"☁️ CF › Create Project (if nonexistent)\"\n          id: task_publish_project_create\n          shell: bash\n          if: steps.task_publish_project_verify.outputs.result != 'true'\n          run: |\n            curl -s -X POST \"https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID || inputs.CLOUDFLARE_ACCOUNT_ID }}/pages/projects\" \\\n              -H \"Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}\" \\\n              -H \"Content-Type:application/json\" \\\n              --data '{\"name\":\"${{ inputs.PROJECT_NAME || 'my-site' }}\", \"production_branch\":\"${{ inputs.BRANCH || 'main' }}\"}'\n\n        - name: \"☁️ Publish to Cloudflare Pages\"\n          id: task_publish_push\n          uses: aetherinox/cloudflare-publish-action@latest\n          with:\n              apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n              accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID || inputs.CLOUDFLARE_ACCOUNT_ID }}\n              projectName: ${{ inputs.PROJECT_NAME || 'my-site' }}\n              directory: ${{ inputs.DIRECTORY_BUILD_OUTPUT || './' }}\n              gitHubToken: ${{ secrets.GITHUB_TOKEN }}\n              branch: ${{ inputs.BRANCH || 'main' }}\n              workingDirectory: ${{ inputs.DIRECTORY_WORKING || './' }}\n              wranglerVersion: ${{ inputs.WRANGLER_VERSION || '3' }}\n```\n\n\n\u003cbr /\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eConfigure node + pre-install wrangler, and push to cloudflare (with inputs)\u003c/summary\u003e\n\n\u003cbr /\u003e\n\nThis example adds the usage of the Cloudflare api to first check if your project name actually exists on Cloudflare, creates the project if not, and then pushes to Cloudflare pages.\n\n\u003cbr /\u003e\n\n```yml\nrun-name: \"☁️ CF › Deploy\"\nname: \"☁️ CF › Deploy\"\n\non:\n  push:\n    branches:\n      - main\n      - master\n\n  workflow_dispatch:\n    inputs:\n      PROJECT_NAME:\n        description:  \"Project Name\"\n        required:     true\n        default:      'my-site'\n        type:         string\n\n      CLOUDFLARE_ACCOUNT_ID:\n        description:  \"Cloudflare Account ID\"\n        required:     true\n        default:      'XXXXXXXXXXXXXXXX'\n        type:         string\n\n      DIRECTORY_BUILD_OUTPUT:\n        description:  \"Build Output Dir\"\n        required:     true\n        default:      './'\n        type:         string\n\n      DIRECTORY_WORKING:\n        description:  \"Working Dir\"\n        required:     true\n        default:      './'\n        type:         string\n\n      WRANGLER_VERSION:\n        description:  \"Wrangler Version\"\n        required:     true\n        default:      '3'\n        type:         string\n\n      BRANCH:\n        description:  'Website Branch'\n        required:     true\n        default:      'main'\n        type:         choice\n        options:\n        - main\n        - master\n\njobs:\n  job-publish:\n      name: \u003e-\n        📦 Publish to Cloudflare\n      runs-on: ubuntu-latest\n      permissions:\n          contents: read\n          deployments: write\n      steps:\n\n        - name: \"☑️ Checkout\"\n          id: task_publish_checkout\n          uses: actions/checkout@v4\n\n        - name: \"⚙️ Setup › Node\"\n          id: task_publish_node_setup\n          uses: actions/setup-node@v4\n          with:\n            node-version: '20.x'\n\n        - name: \"📦 NPM › Install Wrangler\"\n          id: task_publish_npm_install\n          run: |\n            npm install -g npm@latest\n            npm install --global wrangler\n          env:\n            NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n        - name: \"☁️ CF › Check Project\"\n          id: task_publish_project_verify\n          shell: bash\n          run: |\n            check=$(curl -s -X GET \"https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID || inputs.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/${{ inputs.PROJECT_NAME || 'my-site' }}\" \\\n              -H \"Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}\" \\\n              -H \"Content-Type:application/json\" | jq -r '.success')\n            echo \"result=$check\" \u003e\u003e $GITHUB_OUTPUT\n\n        - name: \"☁️ CF › Create Project (if nonexistent)\"\n          id: task_publish_project_create\n          shell: bash\n          if: steps.task_publish_project_verify.outputs.result != 'true'\n          run: |\n            curl -s -X POST \"https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID || inputs.CLOUDFLARE_ACCOUNT_ID }}/pages/projects\" \\\n              -H \"Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}\" \\\n              -H \"Content-Type:application/json\" \\\n              --data '{\"name\":\"${{ inputs.PROJECT_NAME || 'my-site' }}\", \"production_branch\":\"${{ inputs.BRANCH || 'main' }}\"}'\n\n        - name: \"☁️ Publish to Cloudflare Pages\"\n          id: task_publish_push\n          uses: aetherinox/cloudflare-publish-action@latest\n          with:\n              apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n              accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID || inputs.CLOUDFLARE_ACCOUNT_ID }}\n              projectName: ${{ inputs.PROJECT_NAME || 'my-site' }}\n              directory: ${{ inputs.DIRECTORY_BUILD_OUTPUT || './' }}\n              gitHubToken: ${{ secrets.GITHUB_TOKEN }}\n              branch: ${{ inputs.BRANCH || 'main' }}\n              workingDirectory: ${{ inputs.DIRECTORY_WORKING || './' }}\n              wranglerVersion: ${{ inputs.WRANGLER_VERSION || '3' }}\n```\n\n\u003cbr /\u003e\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n---\n\n\u003cbr /\u003e\n\n## Contributors ✨\nWe are always looking for contributors. If you feel that you can provide something useful to this package, then we'd love to review your suggestion. Before submitting your contribution, please review the following resources:\n\n\u003cbr /\u003e\n\nThe following people have helped get this project going:\n\n\u003cdiv align=\"center\"\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![Contributors][badge-all-contributors]](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://gitlab.com/Aetherinox\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/118329232?v=4?s=40\" width=\"40px;\" alt=\"Aetherinox\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAetherinox\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Aetherinox/cloudflare-publish-action?author=Aetherinox\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#projectManagement-Aetherinox\" title=\"Project Management\"\u003e📆\u003c/a\u003e \u003ca href=\"#fundingFinding-Aetherinox\" title=\"Funding Finding\"\u003e🔍\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n---\n\n\u003cbr /\u003e\n\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- BADGE \u003e GENERAL --\u003e\n[link-general-npm]: https://npmjs.com\n[link-general-nodejs]: https://nodejs.org\n[link-npmtrends]: http://npmtrends.com/@aetherinox/cloudflare-publish-action\n\u003c!-- BADGE \u003e VERSION \u003e GITHUB --\u003e\n[badge-version-gh]: https://img.shields.io/github/v/tag/aetherinox/cloudflare-publish-action?logo=GitHub\u0026label=Version\u0026color=ba5225\n[link-version-gh]: https://github.com/aetherinox/cloudflare-publish-action/releases\n\u003c!-- BADGE \u003e VERSION \u003e NPMJS --\u003e\n[badge-version-npm]: https://img.shields.io/npm/v/@aetherinox/cloudflare-publish-action?logo=npm\u0026label=Version\u0026color=ba5225\n[link-version-npm]: https://npmjs.com/package/@aetherinox/cloudflare-publish-action\n\u003c!-- BADGE \u003e LICENSE --\u003e\n[badge-license-mit]: https://img.shields.io/badge/MIT-FFF?logo=creativecommons\u0026logoColor=FFFFFF\u0026label=License\u0026color=9d29a0\n[link-license-mit]: https://github.com/aetherinox/cloudflare-publish-action/blob/main/LICENSE\n\u003c!-- BADGE \u003e BUILD --\u003e\n[badge-build]: https://img.shields.io/github/actions/workflow/status/aetherinox/cloudflare-publish-action/release-npm.yml?logo=github\u0026logoColor=FFFFFF\u0026label=Build\u0026color=%23278b30\n[link-build]: https://github.com/aetherinox/cloudflare-publish-action/actions/workflows/release-npm.yml\n\u003c!-- BADGE \u003e DOWNLOAD COUNT --\u003e\n[badge-downloads-gh]: https://img.shields.io/github/downloads/aetherinox/cloudflare-publish-action/total?logo=github\u0026logoColor=FFFFFF\u0026label=Downloads\u0026color=376892\n[link-downloads-gh]: https://github.com/aetherinox/cloudflare-publish-action/releases\n[badge-downloads-npm]: https://img.shields.io/npm/dw/%40aetherinox%2Fcloudflare-publish-action?logo=npm\u0026\u0026label=Downloads\u0026color=376892\n[link-downloads-npm]: https://npmjs.com/package/@aetherinox/cloudflare-publish-action\n\u003c!-- BADGE \u003e DOWNLOAD SIZE --\u003e\n[badge-size-gh]: https://img.shields.io/github/repo-size/aetherinox/cloudflare-publish-action?logo=github\u0026label=Size\u0026color=59702a\n[link-size-gh]: https://github.com/aetherinox/cloudflare-publish-action/releases\n[badge-size-npm]: https://img.shields.io/npm/unpacked-size/@aetherinox/cloudflare-publish-action/latest?logo=npm\u0026label=Size\u0026color=59702a\n[link-size-npm]: https://npmjs.com/package/@aetherinox/cloudflare-publish-action\n\u003c!-- BADGE \u003e COVERAGE --\u003e\n[badge-coverage]: https://img.shields.io/codecov/c/github/aetherinox/cloudflare-publish-action?token=MPAVASGIOG\u0026logo=codecov\u0026logoColor=FFFFFF\u0026label=Coverage\u0026color=354b9e\n[link-coverage]: https://codecov.io/github/aetherinox/cloudflare-publish-action\n\u003c!-- BADGE \u003e ALL CONTRIBUTORS --\u003e\n[badge-all-contributors]: https://img.shields.io/github/all-contributors/aetherinox/cloudflare-publish-action?logo=contributorcovenant\u0026color=de1f6f\u0026label=contributors\n[link-all-contributors]: https://github.com/all-contributors/all-contributors\n[badge-tests]: https://img.shields.io/github/actions/workflow/status/aetherinox/cloudflare-publish-action/tests.yml?logo=github\u0026label=Tests\u0026color=2c6488\n[link-tests]: https://github.com/aetherinox/cloudflare-publish-action/actions/workflows/tests.yml\n[badge-commit]: https://img.shields.io/github/last-commit/aetherinox/cloudflare-publish-action?logo=conventionalcommits\u0026logoColor=FFFFFF\u0026label=Last%20Commit\u0026color=313131\n[link-commit]: https://github.com/aetherinox/cloudflare-publish-action/commits/main/\n\u003c!-- prettier-ignore-end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faetherinox%2Fcloudflare-publish-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faetherinox%2Fcloudflare-publish-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faetherinox%2Fcloudflare-publish-action/lists"}