Skip to content

Commit

Permalink
Merge pull request #37 from sgcarstrends/v2
Browse files Browse the repository at this point in the history
v2
  • Loading branch information
ruchernchong authored Dec 21, 2024
2 parents 197b122 + f9c7fcc commit 5910407
Show file tree
Hide file tree
Showing 68 changed files with 6,088 additions and 302 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/pulumi.prod.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/pulumi.staging.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/sst.deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: SST Deploy

on:
workflow_call:
inputs:
environment:
required: true
type: string
sst-stage:
required: true
type: string
secrets:
DATABASE_URL:
required: true
UPSTASH_REDIS_REST_URL:
required: true
UPSTASH_REDIS_REST_TOKEN:
required: true
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true

jobs:
deployer:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}

# Concurrency group name ensures concurrent workflow runs wait for any in-progress job to finish
concurrency:
group: merge-${{ github.ref }}

permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: latest
cache: 'pnpm'
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ vars.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install dependencies
run: pnpm install
- name: Run Drizzle Migrations
run: |
pnpm migrate
- name: Deploy
run: |
pnpm sst deploy --stage ${{ inputs.sst-stage }}
19 changes: 19 additions & 0 deletions .github/workflows/sst.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deployment (Production)

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'

permissions:
id-token: write
contents: read

jobs:
deploy:
uses: ./.github/workflows/sst.deploy.yml
with:
environment: Production
sst-stage: prod
secrets: inherit
41 changes: 41 additions & 0 deletions .github/workflows/sst.staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deployment (Staging)

on:
push:
branches:
- '*'
tags-ignore:
- '*'

permissions:
id-token: write
contents: read

jobs:
test:
runs-on: ubuntu-latest
environment: Staging
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run tests
run: pnpm test

deploy:
needs: test
uses: ./.github/workflows/sst.deploy.yml
with:
environment: Staging
sst-stage: staging
secrets: inherit
28 changes: 28 additions & 0 deletions .github/workflows/trigger-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to Trigger.dev (Production)

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: 🚀 Deploy Trigger.dev
env:
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
run: |
pnpm trigger:deploy
Loading

0 comments on commit 5910407

Please sign in to comment.