Update README.md #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Vercel | |
on: | |
push: | |
branches: | |
- main # Deploy when there's a push to the main branch | |
pull_request: | |
branches: | |
- main # Optionally run on pull requests to main branch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" # Specify the Node.js version you're using | |
- name: Install dependencies | |
run: npm install | |
- name: Run TypeScript check (if TypeScript is used) | |
run: | | |
if [ -f tsconfig.json ]; then | |
npm run type-check | |
else | |
echo "Skipping TypeScript check because tsconfig.json is not found." | |
fi | |
- name: Lint codebase | |
run: npm run lint # Run linting to ensure code quality | |
- name: Set Environment Variables | |
run: | | |
echo "NEXT_PUBLIC_FIREBASE_API_KEY=${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}" >> $GITHUB_ENV | |
echo "NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}" >> $GITHUB_ENV | |
# Add other environment variables as needed | |
- name: Build Next.js app | |
run: npm run build | |
- name: Deploy to Vercel | |
run: | | |
npm install -g vercel | |
vercel --prod --token=${{ secrets.VERCEL_TOKEN }} | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} |