Skip to content

Commit

Permalink
chore: setup CICD (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
guan404ming committed Apr 26, 2024
1 parent 240fa68 commit 49aeb80
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Code Check

on:
pull_request:
branches: ["*"]

jobs:
lint:
runs-on: ubuntu-latest
name: lint
steps:
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install dependencies
run: yarn install

- run: yarn lint
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install dependencies
run: yarn install

- name: Code check
run: yarn lint

- name: Deploy to Vercel
if: success()
uses: amondnet/[email protected]
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
7 changes: 7 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"git": {
"deploymentEnabled": {
"main": false
}
}
}

0 comments on commit 49aeb80

Please sign in to comment.