Skip to content

Commit

Permalink
ci: add gh action for release and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitkolhe committed Mar 24, 2024
1 parent c82a1c3 commit b1fd1c7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yaml
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
Expand All @@ -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]
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release.yaml
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 }}

0 comments on commit b1fd1c7

Please sign in to comment.