From 79b2bbd0faac391a53e18dd1e1c89d2bc7bf6a7f Mon Sep 17 00:00:00 2001 From: DevAnsar Date: Fri, 5 Jan 2024 01:50:14 +0330 Subject: [PATCH] Update deploying-static.yml --- .github/workflows/deploying-static.yml | 15 +++----- .github/workflows/main | 51 -------------------------- docs/package.json | 2 +- docs/vite.config.ts | 2 +- 4 files changed, 7 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/main 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/', })