Publish script: avoid need to purge gh image cache
By using a raw.githubusercontent.com url, github no longer uses the camo cache, and so I can avoid bothering with cache clearing.
This commit is contained in:
parent
54e617139c
commit
d95df6a76a
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
|
@ -64,7 +64,3 @@ jobs:
|
||||||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
publish_dir: ./publish
|
publish_dir: ./publish
|
||||||
force_orphan: true
|
force_orphan: true
|
||||||
|
|
||||||
- name: Clear cached images
|
|
||||||
if: ${{ github.event_name != 'pull_request'}}
|
|
||||||
run: ~/.config/doom/misc/config-publishing/clear-github-cached-images.sh
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
[[https://img.shields.io/badge/Emacs-27.1-blueviolet.svg?style=flat-square&logo=GNU%20Emacs&logoColor=white]]
|
[[https://img.shields.io/badge/Emacs-27.1-blueviolet.svg?style=flat-square&logo=GNU%20Emacs&logoColor=white]]
|
||||||
[[https://img.shields.io/github/workflow/status/tecosaur/emacs-config/Publish/master.svg?style=flat-square]]
|
[[https://img.shields.io/github/workflow/status/tecosaur/emacs-config/Publish/master.svg?style=flat-square]]
|
||||||
[[https://tecosaur.github.io/emacs-config/misc/pkg-status.svg]]
|
[[https://raw.githubusercontent.com/tecosaur/emacs-config/gh-pages/misc/pkg-status.svg]]
|
||||||
|
|
||||||
:end:
|
:end:
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
|
|
||||||
|
|
||||||
(setq log-file (format "%s-log.txt" (file-name-base load-file-name)))
|
|
||||||
|
|
||||||
(load (expand-file-name "initialise.el" (file-name-directory load-file-name)) nil t)
|
|
||||||
(initialise)
|
|
||||||
|
|
||||||
(let (relevant-lines)
|
|
||||||
(with-current-buffer (url-retrieve-synchronously "https://github.com/tecosaur/emacs-config/blob/master/README.org")
|
|
||||||
(while (search-forward "data-canonical-src=\"https://tecosaur.github.io/emacs-config/" nil t)
|
|
||||||
(push (thing-at-point 'line) relevant-lines)))
|
|
||||||
(dolist (line relevant-lines)
|
|
||||||
(when-let ((cached-img (when (string-match "href=\"\\([^\"]+\\)\"" line)
|
|
||||||
(match-string 1 line))))
|
|
||||||
(let ((url-request-method "PURGE"))
|
|
||||||
(message "[36] Asking github to purge %s" cached-img)
|
|
||||||
(with-current-buffer
|
|
||||||
(url-retrieve-synchronously cached-img)
|
|
||||||
(message "%s" (buffer-string)))))))
|
|
||||||
|
|
||||||
(setq inhibit-message t)
|
|
||||||
(kill-emacs exit-code)
|
|
Loading…
Reference in a new issue