cloudflare / pages-action

MIT License
468 stars 95 forks source link

Create project if not exists #51

Closed stavros-k closed 1 month ago

stavros-k commented 1 year ago

It would be nice, when making a publish, check if the project exists, and if not. create it.

That will also require to have an extra option to define which the production branch will be. Like you do with wrangler pages project create PROJECT-NAME --production-branch=NAME-OF-PROD-BRANCH

Use case, we publish multiple sites from a base template that builds on CI for each store. It will save some time if we just had to add the store details in the CI matrix, and the action took care of the project creation.

gabynevada commented 11 months ago

This would also help use cases such as monorepos, allowing to just create a new project on the monorepo and it automatically having a cloudfare pages instance to preview it ready to go.

nprogers commented 1 month ago

Hello! We're working on porting this repo to wrangler-action, and stepping up maintenance there. This functionality doesn't exist in wrangler today, so we cannot support it from an action. You can request it as a feature in the workers-sdk repo. In the meantime, I suggest that you add an if statement to your yaml to check to see if the project exists. You can then create it before moving on to the deploy step.