diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b4b1b7f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main # 或者你正在使用的其他主分支 + - dev + +permissions: + contents: write # 确保 GITHUB_TOKEN 有写权限 + pages: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install dependencies + run: yarn install # 或者 npm install + + - name: Build project + run: yarn build # 或者 npm run build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist + # destination_dir: navpress # 部署到 navpress 子目录,不指定就是根目录 + # cname: aaronlamz.github.io # 可选: 如果你需要自定义域名 \ No newline at end of file diff --git a/README.md b/README.md index aac5117..61ae2b5 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ # NavPress [![npm version](https://img.shields.io/npm/v/navpress.svg)](https://www.npmjs.com/package/navpress) +[![Deploy to GitHub Pages](https://github.com/aaronlamz/navpress/actions/workflows/deploy.yml/badge.svg)](https://github.com/aaronlamz/navpress/actions/workflows/deploy.yml) **NavPress** is a CLI tool for generating static navigation websites. It allows you to quickly build a navigation site through a configuration file, supporting both development and production modes. @@ -13,7 +14,7 @@ - Integrates with Tailwind CSS and Vue.js. ## Preview -![demo](./demo.png) +[View Demo](https://aaronlamz.github.io/navpress/) ## Installation diff --git a/package.json b/package.json index c167b5b..a42fb03 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "keywords": ["navpress"], "author": "aaronlamz", "engines": { - "node": ">=20" + "node": ">=18" }, "engineStrict": true, "license": "MIT",