diff --git a/.github/workflows/deploying-static.yml b/.github/workflows/deploying-static.yml index 44a7c6c..b07d8d4 100644 --- a/.github/workflows/deploying-static.yml +++ b/.github/workflows/deploying-static.yml @@ -38,14 +38,9 @@ jobs: - name: Install dependencies run: npm install - name: Build - run: npm run build - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - # Upload dist repository - path: './dist' + run: npm run build --prefix docs - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.CODECOV_TOKEN }} + publish_dir: docs/dist diff --git a/.github/workflows/main b/.github/workflows/main deleted file mode 100644 index ddc4056..0000000 --- a/.github/workflows/main +++ /dev/null @@ -1,51 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ['main'] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: 'pages' - cancel-in-progress: true - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Node - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'npm' - - name: Install dependencies - run: npm install - - name: Build - run: npm run build - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - # Upload dist repository - path: './docs/dist' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 diff --git a/docs/package.json b/docs/package.json index c3e9b8e..bfdf241 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,7 +3,7 @@ "private": true, "version": "0.0.0", "type": "module", - "homepage": "https://devansar.github.io/react-search-hook/docs", + "homepage": "https://devansar.github.io/react-search-hook/", "scripts": { "dev": "vite", "build": "tsc && vite build", diff --git a/docs/vite.config.ts b/docs/vite.config.ts index 741e76e..281719b 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -4,5 +4,5 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], - base: '/react-search-hook/docs', + base: '/react-search-hook/', })