From 2985e0b5dea2851e9c5bb1f835e1f9a2c9e1639b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=98=88=EC=A7=84?= Date: Mon, 12 Feb 2024 19:09:59 +0900 Subject: [PATCH] add workflow --- .github/make-post-list.js | 8 ++++---- .github/workflows/make-post-list.yml | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/make-post-list.js b/.github/make-post-list.js index 5c7acc2..0e96d36 100644 --- a/.github/make-post-list.js +++ b/.github/make-post-list.js @@ -2,7 +2,7 @@ const core = require("@actions/core"); const fs = require("fs"); const path = require("path"); -const postBasePath = "/src/posts"; +const postBasePath = "/"; const blogPath = "https://www.oooooroblog.com"; const getPostPath = (filePath) => path.join(process.cwd(), postBasePath, filePath); @@ -54,7 +54,7 @@ const getAllFilePath = async (dirPath) => { ...(await readFromDirectory(joined)).map((foundName) => [ [dir, name].join("/"), foundName, - ]), + ]) ); } } @@ -95,12 +95,12 @@ const postCount = 5; paths.map(async (filePath) => ({ filePath, stat: await getFileStat(path.join(process.cwd(), postBasePath, filePath)), - })), + })) ); const metas = await Promise.all( fileStats .map(({ filePath }) => getFileMeta(getPostPath(filePath))) - .filter(Boolean), + .filter(Boolean) ); const filtered = metas .sort((a, b) => new Date(b.date) - new Date(a.date)) diff --git a/.github/workflows/make-post-list.yml b/.github/workflows/make-post-list.yml index 795fd46..644504d 100644 --- a/.github/workflows/make-post-list.yml +++ b/.github/workflows/make-post-list.yml @@ -1,4 +1,5 @@ name: make recent post list +on: [push, workflow_dispatch] jobs: make: runs-on: macos-latest