-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add gh action for release and tests
- Loading branch information
1 parent
c82a1c3
commit b1fd1c7
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
relase: | ||
name: Test and Deploy | ||
name: Test and Deploy to Staging | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
|
@@ -19,6 +22,9 @@ jobs: | |
uses: oven-sh/[email protected] | ||
- run: bun install | ||
|
||
- name: Run Tests | ||
run: bun run test | ||
|
||
- name: Deploy to Staging | ||
id: deploy-vercel-staging | ||
uses: amondnet/[email protected] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Deploy To Production | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
deploy-production: | ||
name: Run Tests and Deploy to Production | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache Dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.bun | ||
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} | ||
restore-keys: ${{ runner.os }}-bun- | ||
|
||
- name: Setup Bun | ||
uses: oven-sh/[email protected] | ||
- run: bun install | ||
|
||
- name: Run Tests | ||
run: bun run test | ||
|
||
- name: Deploy to Production | ||
uses: amondnet/[email protected] | ||
id: deploy-vercel-production | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
with: | ||
vercel-token: ${{ secrets.VERCEL_TOKEN }} | ||
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | ||
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_TL_ENGINE }} | ||
vercel-args: --prod | ||
scope: ${{ secrets.VERCEL_ORG_ID }} |