Skip to content

Commit

Permalink
chore: update cicd script
Browse files Browse the repository at this point in the history
  • Loading branch information
frattezi committed Jun 15, 2024
1 parent b31cf1f commit 3b69cd7
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 15 deletions.
59 changes: 45 additions & 14 deletions .github/workflows/merge-request.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,56 @@
name: Merge Request Quality Gate
name: Deploy to Vercel

on: pull_request

jobs:
lint-and-build:
# lint-and-test:
# 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: 20

# - name: Install dependencies
# run: yarn

# - name: Run lint
# run: yarn lint

# - name: Run tests
# run: yarn test

build-and-deploy:
runs-on: ubuntu-latest
name: Lint and build
environment: Production
needs: lint-and-test

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Setup node 20
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install dependencies
run: yarn
- name: Install dependencies
run: echo ${{ secrets.DATABASE_URL }}

- name: Install dependencies
run: echo ${{ secrets.DATABASE_URL }} > .env

- name: Lint code
run: yarn lint
- name: Install dependencies
run: yarn

- name: Run database migrations
run: yarn migrate

- name: Check build
run: yarn build
- name: Deploy to Vercel
run: vercel --prod
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"cSpell.words": ["biomejs", "lefthook", "tailwindcss"]
"cSpell.words": ["biomejs", "lefthook", "tailwindcss", "Vercel"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "biome check",
"migrate": "prisma migrate dev",
"format": "biome format",
"postinstall": "prisma generate"
},
Expand Down

0 comments on commit 3b69cd7

Please sign in to comment.