Skip to content

Commit

Permalink
ci: fix docker build failure (#40)
Browse files Browse the repository at this point in the history
* wip: add directory check

* refactor: the target of replace more explicitly

* wip: change directory output command

* build: change node version

* refactor: replace id param

* docs: fix function style in comment

* ci: remove directory structure output

* revert: undo process

* wip: remove empty slug from path

* ci: re-add directory check

* ci: change step

* build: make explicit a copy of the post folder

* ci: change contents permissions

* chore: change README.md file ignore rule

* ci: add chown command

* ci: add context option

* refactor: cleanup codes

* revert: image node version

* revert: remove redundant COPY
  • Loading branch information
turtton authored Apr 3, 2023
1 parent 77ae14c commit 9e2db49
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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: .
4 changes: 2 additions & 2 deletions src/pages/[...id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9e2db49

Please sign in to comment.