Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add test component #1

Merged
merged 15 commits into from
Aug 19, 2024
33 changes: 25 additions & 8 deletions .github/workflows/Deploy Preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest

steps:
Expand All @@ -16,7 +16,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.17.0'
node-version: '18.17.0'

- name: Install dependencies
run: npm install
Expand All @@ -25,10 +25,27 @@ jobs:
run: npm run build

- name: Deploy to Vercel
uses: amondnet/vercel-action@v20
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |
DEPLOY_URL=$(npx vercel --prod --token $VERCEL_TOKEN --confirm | tail -n 1)
echo "Vercel Deployment URL: $DEPLOY_URL"
echo "DEPLOY_URL=$DEPLOY_URL" >> $GITHUB_ENV
id: vercel-deploy

- name: Comment on Pull Request
uses: actions/github-script@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-args: '--prod'
working-directory: ./
github-token: ${{ secrets.GITHUB_TOKEN }}
scope: ruslanlukoanov0-gmailcom
script: |
const { DEPLOY_URL } = process.env;
const issue_number = context.payload.pull_request.number;
await github.rest.issues.createComment({
issue_number: issue_number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Deployed to Vercel: ${DEPLOY_URL}`
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint . --ext .ts,.tsx,.jsx",
"lint": "eslint . --ext .ts,.tsx,.jsx --max-warnings=0",
"prepare": "husky",
"commitlint": "commitlint --edit"
},
Expand Down
1 change: 1 addition & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable max-len */
import Image from 'next/image';
import styles from './page.module.css';

Expand Down
9 changes: 9 additions & 0 deletions src/components/test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

interface Props {
className?: string;
}

export const Test: React.FC<Props> = ({ className }) => {
return <div className={className}></div>;
};
Loading