From 9476fe354d5489933c507603b909c2a7fdf9195e Mon Sep 17 00:00:00 2001 From: mhshohan1 Date: Sun, 25 Feb 2024 17:36:35 +0600 Subject: [PATCH] update github workflow --- .github/workflows/client.yaml | 36 +++++++++---------- .../managements/PurchaseManagementPage.tsx | 2 +- .../features/{ => management}/purchaseApi.ts | 2 +- 3 files changed, 18 insertions(+), 22 deletions(-) rename client/src/redux/features/{ => management}/purchaseApi.ts (93%) diff --git a/.github/workflows/client.yaml b/.github/workflows/client.yaml index f461285..e78c90a 100644 --- a/.github/workflows/client.yaml +++ b/.github/workflows/client.yaml @@ -1,5 +1,9 @@ name: Inventory Client Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + on: push: paths: @@ -8,30 +12,22 @@ on: - main jobs: - build-and-deploy: + Deploy-Production: runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 + - name: Install Vercel CLI + run: npm install --global vercel - - name: Change Directory to Client - run: cd ./client + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - name: Install dependencies - run: npm install + - name: change to client directory + run: cd ./client - - name: Build - run: npm run build + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - - name: Deploy to Vercel - uses: amondnet/vercel-deployment@v1 - with: - vercel_token: ${{ secrets.VERCEL_TOKEN }} - vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID }} - vercel_scope: ${{ secrets.VERCEL_SCOPE }} + - name: Deploy Project Artifacts + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} diff --git a/client/src/pages/managements/PurchaseManagementPage.tsx b/client/src/pages/managements/PurchaseManagementPage.tsx index 22fd94d..d84f98a 100644 --- a/client/src/pages/managements/PurchaseManagementPage.tsx +++ b/client/src/pages/managements/PurchaseManagementPage.tsx @@ -3,7 +3,7 @@ import type { PaginationProps, TableColumnsType } from 'antd'; import { Button, Flex, Modal, Pagination, Table } from 'antd'; import { useState } from 'react'; import { FieldValues, useForm } from 'react-hook-form'; -import { useGetAllPurchasesQuery } from '../../redux/features/purchaseApi'; +import { useGetAllPurchasesQuery } from '../../redux/features/management/purchaseApi'; import { IProduct } from '../../types/product.types'; import { IPurchase } from '../../types/purchase.types'; import formatDate from '../../utils/formatDate'; diff --git a/client/src/redux/features/purchaseApi.ts b/client/src/redux/features/management/purchaseApi.ts similarity index 93% rename from client/src/redux/features/purchaseApi.ts rename to client/src/redux/features/management/purchaseApi.ts index 154803c..679eab2 100644 --- a/client/src/redux/features/purchaseApi.ts +++ b/client/src/redux/features/management/purchaseApi.ts @@ -1,4 +1,4 @@ -import { baseApi } from "./baseApi"; +import { baseApi } from "../baseApi"; const purchaseApi = baseApi.injectEndpoints({ endpoints: (builder) => ({