From 21d6f3482eedcefd7fadbc21aa6efccc5f9144db Mon Sep 17 00:00:00 2001 From: hantang <34468720+hantang@users.noreply.github.com> Date: Sun, 27 Oct 2024 10:20:15 +0800 Subject: [PATCH] Update deploy --- {archive => .github}/workflows/deploy.yml | 7 ++++++- README.md | 3 +++ deploy.sh | 21 ++++++++++++++++----- package.json | 2 +- 4 files changed, 26 insertions(+), 7 deletions(-) rename {archive => .github}/workflows/deploy.yml (80%) diff --git a/archive/workflows/deploy.yml b/.github/workflows/deploy.yml similarity index 80% rename from archive/workflows/deploy.yml rename to .github/workflows/deploy.yml index 97eca1b..0bef6ae 100644 --- a/archive/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,13 +14,18 @@ jobs: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} + env: + TARGET: site + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/configure-pages@v4 + - name: Build + run: bash deploy.sh ${{ env.TARGET }} - uses: actions/upload-pages-artifact@v3 with: - path: "./src/site" + path: ${{ env.TARGET }} - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index e5a2380..33d703a 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,9 @@ Search your bookmarks in a more flexible way. - web online version: ![snapshot](images/snapshot-web.png) +## Changelog + +- :tada: Add `pintree` page, forked from [Pintree-io/pintree](https://github.com/Pintree-io/pintree). ## More diff --git a/deploy.sh b/deploy.sh index beec729..2199d21 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,14 +1,25 @@ #!/usr/bin/env bash set -eu +TARGET="${1:-site}" +SOURCE="${2:-src}" -TARGET="site" +ignores=("manifest.json" "popup.html") -pwd +echo "target: ${TARGET} / source: ${SOURCE}" if [[ -d $TARGET ]]; then - echo "*** clean $TARGET" - rm -rf $TARGET + echo "*** clean $TARGET" + rm -rf $TARGET fi -cp -r src/$TARGET ./$TARGET + +echo "copy to target" +cp -r ${SOURCE} ./$TARGET + +echo "clean to ignores" +for name in "${ignores[@]}"; do + if [[ -f $TARGET/$name ]]; then + rm -rf $TARGET/$name + fi +done echo "Done" diff --git a/package.json b/package.json index ecef1b3..e2f35c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bookmark-search", - "version": "0.3.0", + "version": "0.4.0", "description": "HTML Bookmark Search with RegExp", "main": "main.js", "keywords": [