fix: remove file command dependency from Bunny deploy
efdcb88 parent: cdf9f8f modified
.rickub/workflows/deploy-bunny.yml +16 -1 | @@ -94,7 +94,22 @@ jobs: | ||
| 94 | 94 | |
| 95 | 95 | find out -type f -print0 | while IFS= read -r -d '' file; do |
| 96 | 96 | relative_path="${file#out/}" |
| 97 | - mime_type="$(file --brief --mime-type "$file")" | |
| 97 | + case "${relative_path##*.}" in | |
| 98 | + html) mime_type="text/html; charset=utf-8" ;; | |
| 99 | + css) mime_type="text/css; charset=utf-8" ;; | |
| 100 | + js) mime_type="application/javascript; charset=utf-8" ;; | |
| 101 | + svg) mime_type="image/svg+xml" ;; | |
| 102 | + txt) mime_type="text/plain; charset=utf-8" ;; | |
| 103 | + woff2) mime_type="font/woff2" ;; | |
| 104 | + json) mime_type="application/json; charset=utf-8" ;; | |
| 105 | + png) mime_type="image/png" ;; | |
| 106 | + jpg|jpeg) mime_type="image/jpeg" ;; | |
| 107 | + webp) mime_type="image/webp" ;; | |
| 108 | + ico) mime_type="image/x-icon" ;; | |
| 109 | + xml) mime_type="application/xml; charset=utf-8" ;; | |
| 110 | + webmanifest) mime_type="application/manifest+json" ;; | |
| 111 | + *) mime_type="application/octet-stream" ;; | |
| 112 | + esac | |
| 98 | 113 | |
| 99 | 114 | echo "Uploading $relative_path" |
| 100 | 115 | curl --fail --silent --show-error \ |
| @@ -94,7 +94,22 @@ jobs: | |||
| 94 | 94 | ||
| 95 | find out -type f -print0 | while IFS= read -r -d '' file; do | 95 | find out -type f -print0 | while IFS= read -r -d '' file; do |
| 96 | relative_path="${file#out/}" | 96 | relative_path="${file#out/}" |
| 97 | - mime_type="$(file --brief --mime-type "$file")" | 97 | + case "${relative_path##*.}" in |
| 98 | + html) mime_type="text/html; charset=utf-8" ;; | ||
| 99 | + css) mime_type="text/css; charset=utf-8" ;; | ||
| 100 | + js) mime_type="application/javascript; charset=utf-8" ;; | ||
| 101 | + svg) mime_type="image/svg+xml" ;; | ||
| 102 | + txt) mime_type="text/plain; charset=utf-8" ;; | ||
| 103 | + woff2) mime_type="font/woff2" ;; | ||
| 104 | + json) mime_type="application/json; charset=utf-8" ;; | ||
| 105 | + png) mime_type="image/png" ;; | ||
| 106 | + jpg|jpeg) mime_type="image/jpeg" ;; | ||
| 107 | + webp) mime_type="image/webp" ;; | ||
| 108 | + ico) mime_type="image/x-icon" ;; | ||
| 109 | + xml) mime_type="application/xml; charset=utf-8" ;; | ||
| 110 | + webmanifest) mime_type="application/manifest+json" ;; | ||
| 111 | + *) mime_type="application/octet-stream" ;; | ||
| 112 | + esac | ||
| 98 | 113 | ||
| 99 | echo "Uploading $relative_path" | 114 | echo "Uploading $relative_path" |
| 100 | curl --fail --silent --show-error \ | 115 | curl --fail --silent --show-error \ |