-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CloudFlare - Invalidate cache on deployment #154
Conversation
runs after deployment
Makefile
Outdated
@@ -44,6 +46,7 @@ deps: deps-$(OS) \ | |||
packages/install/hugo \ | |||
packages/install/htmltest | |||
asciinema auth | |||
npm install -g cloudflare-cli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version pin
Makefile
Outdated
|
||
## Invalidate CloudFlare cache (all files) | ||
invalidate-cache: | ||
cfcli purge \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use @
here so our key is not exposed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, let's use these instead:
CF_API_KEY # maps to token
CF_API_EMAIL # maps to email
CF_API_DOMAIN # maps to domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CF_API_KEY # maps to token CF_API_EMAIL # maps to email CF_API_DOMAIN # maps to domain
* use package.json to manage npm dependencies * use fixed version of cfcli * use invalidate-cache as npm script
package.json
Outdated
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"invalidate-cache": "./node_modules/.bin/cfcli purge" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance we can just run cfcli purge
directly from Makefile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, we can do it by adding ./node_modules/.bin/
to the PATH
.
But such kind of commands (that uses dev deps) wrapped into npm scrips.
* remove package.json * install npm packages to global scope * directly call cfcli from make file
… into feature/cloudflare-cache
what
why