I have created a CD pipeline with GitHub Actions
name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Create .env file
run: |
echo "NEXT_PUBLIC_SITE_URL=${{ secrets.NEXT_PUBLIC_SITE_URL }}" >> .env
echo "ENV=production" >> .env
echo "NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }}" >> .env
echo "NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }}" >> .env
echo "GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }}" >> .env
echo "GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }}" >> .env
echo "MICROSOFT_CLARITY_KEY=${{ secrets.MICROSOFT_CLARITY_KEY }}" >> .env
shell: bash
- name: Delete exiting build command
run: rm -rf .next
- name: Install dependencies
run: npm install
- name: Build the project
run: npm run build --if-present
- name: Restart PM2
run: pm2 restart all
- name: Restart Nginx
run: sudo systemctl restart nginx
When npm run build
executes it says:
Property 'classNames' does not exist on type 'IntrinsicAttributes & MergeWithAs<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, Omit<...>, AvatarGroupProps, "div">'. Did you mean 'className'?
I am using next-ui, TypeScript. I can’t find why it is coming. The error is coming from this component, https://nextui.org/docs/components/avatar. The npm run build
works fine without Continuous Deployment.