bogdaaamn / deta-deploy-action

Simple GitHub Action to deploy current repo to a Deta Micro
https://github.com/marketplace/actions/deploy-to-deta
MIT License
79 stars 17 forks source link

Update action.yml #4

Closed cody-scott closed 1 month ago

cody-scott commented 2 years ago

Remove the tmp/ directory before pushing to deta.

After a number of pushes i was hitting the following error

Deploying...
Error: failed to deploy: Request entity too large
Error: Process completed with exit code 1.

Removing the tmp/ directory seemed to resolve the error.

Uncertain, but my guess is that each deploy was containing the tmp for the previous deploy.

HarshKapadia2 commented 2 years ago

Hey @namur007 you've caught the problem and given a solution, but don't you think it would be better to delete the tmp directory right in the step in which it was created (Clone Deta Metadata) rather than in 'Deploy to Deta' step?

cody-scott commented 2 years ago

@HarshKapadia2 I agree. Updated to reflect the change.

HarshKapadia2 commented 2 years ago

You're sure rm -rf tmp/ won't be required, right?

aavshr commented 2 years ago

hi @HarshKapadia2 @namur007 @BogDAAAMN thanks for all the work!

The problem is mainly caused by the relative tmp folder. We should not clone to ./tmp as it will fail in cases where the Micro's code already has a tmp folder; deta clone will not clone to an existing non-empty directory.

I think the better solution will be to clone to /tmp/{micro-name} (or $HOME/.deta/tmp/{micro-name} if github doesn't allow creating a root tmp dir)

  1. mkdir -p /tmp/{micro-name}
  2. deta clone --name {micro-name} --project {project-name} /tmp/{micro-name}
  3. cp -r /tmp/{micro-name}/.deta .
HarshKapadia2 commented 2 years ago

Makes sense @aavshr!

Adding another step to delete the cloned Micro data is important to solve the original problem.

So the steps are:

  1. mkdir -p /tmp/{micro-name}
  2. deta clone --name {micro-name} --project {project-name} /tmp/{micro-name}
  3. cp -r /tmp/{micro-name}/.deta .
  1. rm -rf /tmp/{micro-name}
HarshKapadia2 commented 2 years ago

Hey @namur007 can you please make the required changes?

HarshKapadia2 commented 2 years ago

@namur007 @BogDAAAMN any updates?

HarshKapadia2 commented 2 years ago

Due to inactivity here, I created a new Action, which is a fork of this repository: HarshKapadia2/deta-deploy

cody-scott commented 2 years ago

Due to inactivity here, I created a new Action, which is a fork of this repository: HarshKapadia2/deta-deploy

Sorry. Yes. B I was having a problem with the clone command not wanting to clone to the root. I found a workable solution with the clone and remove method as discussed prior.

HarshKapadia2 commented 2 years ago

What was the solution you found @namur007? Can you send a link to it and/or explain it?