ReadAlongs / Studio-Web

Suite of web packages for creating interactive ReadAlongs (this repo was formerly called Web-Component)
https://readalong-studio.mothertongues.org/
Other
9 stars 9 forks source link

Clean up PR previews once we're done with them #285

Closed joanise closed 3 months ago

joanise commented 4 months ago

Right now, PR previews accumulate without limit, and I have twice manually removed old ones.

The problem: each PR preview includes three copies of the en-us model from SoundSwallower, and that makes our gh-pages artefacts quite large (586 MB before I cleaned up today, 258MB now).

I tried replacing all the copies with symlinks, but that turns out not to be a solution: the upload artifact action dereferences the symlinks as it creates the artifact! ☹️

On https://github.com/marketplace/actions/deploy-pr-preview, the authors of the PR preview action actually recommend running on PR closed events too, and it will automatically delete previews for closed PRs for us. I think this is what we should do, to keep our gh-pages deployments small, as recommended.

We're still clear of the 1GB hard limit at the moment, but I believe we would have busted it if I had not cleaned up manually. I'd like to use a self-cleaning setup so I don't have to think about it.

dhdaines commented 3 months ago

Yeah, I think somewhere along the line GitHub is running on Windows, thus no symlinks for you!

From what I can tell this is literally as simple as adding closed to on.pull_request.types because the default behaviour is to remove the preview in that case.

joanise commented 3 months ago

From what I can tell this is literally as simple as adding closed to on.pull_request.types because the default behaviour is to remove the preview in that case.

That's my understanding, indeed.

@roedoejet are you OK with PR previews being auto-removed as soon as a PR is closed?