-
Notifications
You must be signed in to change notification settings - Fork 9
create github action that purges modified static files #465
Comments
this possibly should be a node implementation over shell script |
see an example on how to react on a push event: |
Shure this should be a gh action? Seems like a bit of an odd choice…; how should this action be exposed to users? How should people enable it for their page? If enabled automatically for every repository, how should we make that happen? Might be useful to use the format of a user story: How is the behaviour right now as a user of helix-pages? How should it change? |
The Blog currently uses a project-specific GH action to purge the outer and inner CDN cache of all known static files when a push occurs. It would be easier if projects could simply refer to a pre-built action instead of each project building their own script. This pre-built action should use the same HLXPURGE method of purging, but it should figure out which files to purge based on the pushed commits and the base URL from a config. Building a GH action is easier than building a full-blown GH app. |
So what would be the user flow to enable this? Shouldn't it be enabled by default? |
Btw, the HLXPURGE HTTP verb, have we considered the potential impact such an http method can have on the possibility of amplified DOS attacks when unauthenticated? |
the user would add a |
We have, and decided to leave it open. |
How should the action determine which files to purge? It should probably for instance pure X.html for a changed X.md file. Where should these rewriting rules come from? |
https://github.com/koraa/hlx-gh-action-purge-updated-cache Please review before elevation to adobe/ repo. Outstanding todos:
|
|
No rewriting needed, the action works as is |
@koraa looks good so far. what's missing is a way to filter the files that should trigger the purge. e.g. only the modified files below |
Wasn't a requirement in the ticket. Please specify a way to provide these filters… |
The outer CDN URL should be optional, ref--repo--owner.hlx.page can be used. |
Can someone please test this in the blog to see if it actually works before I move the repo and reset the git history? |
hmm...right. I forgot to mention it. best would be using an input property:
|
please move it to would be best to follow the pattern of the other actions: |
Precisely which grammar should this use. Looks like glob patterns, but those are not really standardized; your example looks like using the Given that this is not entirely trivial, I think it would be better to open a ticket in the repo with the full specification once it's been moved rather than hash this out as part of this ticket unless @davidnuescheler thinks this urgently needs to be added. |
Looks like I have insufficient permissions to move into adobe-rnd. Somebody else will have to go for it. |
@koraa use https://www.npmjs.com/package/glob, and whatever pattern they support. that's what we use elsewhere. IMO it is important to add this - you can also hardcode the |
Please move that requirment into it's own ticket after the repo has been moved. |
@koraa you need to give me admin rights on that repository, otherwise I cannot move it. |
I created the issue adobe-rnd/github-purge-cache-action#2 |
Right, I added @trieloff @tripodsan and @davidnuescheler any one of you should be able to move :) |
similar to https://github.com/adobe/theblog/blob/master/.github/workflows/purge-code.yaml, just a bit smarter to automatically purge the files that were pushed.
The text was updated successfully, but these errors were encountered: