Skip to content
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

ci: fix docker build failure #40

Merged
merged 19 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Dockerfile
.dockerignore
node_modules
npm-debug.log
README.md
/README.md
.next
.git
3 changes: 2 additions & 1 deletion .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ jobs:
uses: docker/build-push-action@v4
with:
file: ./Dockerfile
push: false
push: false
context: .
6 changes: 3 additions & 3 deletions src/pages/[...id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export async function getStaticPaths(): Promise<{
}> {
clearPublicDir();
const directoryData = getDirectoryData();
const searchIndex = getSearchIndex()
const searchIndex = getSearchIndex();
const slugs = await initCache(
JSON.stringify(directoryData),
JSON.stringify(searchIndex),
Expand All @@ -138,8 +138,8 @@ export async function getStaticPaths(): Promise<{
);
// TODO allows to put in image files in `posts` directory
const paths = slugs.map((p) => ({
params: { id: p.replace("/", "").split("/") },
}));
params: { id: p.replace(/^\//, "").split("/") },
})).filter((p) => p.params.id.length !== 0 && p.params.id[0] !== "");
return {
paths,
fallback: false,
Expand Down