git action added #1
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Check if repository is a fork | |
run: | | |
if [ "${{ github.repository_owner }}" != "a4arpon" ]; then | |
echo "This is not the forked repository, skipping the workflow." | |
exit 1 | |
fi | |
- name: Set up Bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
run: bun install | |
- name: Lint code | |
run: bun run lint | |
- name: Build | |
run: bun run build | |
- name: Rename dist folder to app | |
run: | | |
if [ -d "dist" ]; then | |
mv dist server | |
fi | |
- name: Remove Src | |
run: rm -rf src | |
- name: Deploy to Vercel | |
run: | | |
npm install -g vercel | |
vercel --prod --token ${{ secrets.VERCEL_TOKEN }} | |
env: | |
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} |