Skip to content

Commit a5c902d

Browse files
authored
fix: avoid removing necessary files (#327)
1 parent 69bf842 commit a5c902d

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.github/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ server {
3535
try_files $uri $uri/ /index.html =404;
3636
}
3737

38-
location ~* \.(?:css|js|mjs|jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
38+
location ~* \.(?:css|js|json|mjs|md|jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
3939
if ($cors != "") {
4040
add_header 'Access-Control-Allow-Origin' "$cors" always;
4141
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ jobs:
100100
- name: 'Container: Build and publish dev image'
101101
if: github.ref == 'refs/heads/main'
102102
run: |
103+
node ./scripts/clean-docs-files.mts
104+
103105
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
104106
docker build --tag $IMAGE_REPO_DOCS:dev-fat .
105107
mint slim \

scripts/clean-docs-files.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { readdirSync, unlinkSync } from 'node:fs';
22
import { extname, join } from 'node:path';
33

44
const allowedExtensions =
5-
/^\.(s?css|html?|m?js|json|ts|map|ico|jpe?g|png|svg|woff2|txt|gitignore|gitkeep|stackblitzrc)$/;
5+
/^\.(s?css|html?|m?js|json|ts|map|ico|jpe?g|png|svg|woff2|md|txt|gitignore|gitkeep|stackblitzrc)$/;
66
// Removes all files not matching allowed extensions from given directory.
77
readdirSync(new URL('../dist/docs', import.meta.url), { withFileTypes: true, recursive: true })
8-
.filter((d) => d.isFile() && !allowedExtensions.test(extname(d.name)))
8+
.filter((d) => d.isFile() && !allowedExtensions.test(extname(d.name) || d.name))
99
.forEach((d) => {
1010
console.log(`Removing ${join(d.parentPath, d.name)}`);
1111
unlinkSync(join(d.parentPath, d.name));

src/docs/assets/stackblitz/.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)