Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Deployment Scripts and Variables #86

Merged
merged 5 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DATABASE_URL: ${{ secrets.PROD_DB_URL }}

jobs:
deploy:
if: (!contains(github.event.pull_request.labels.*.name, 'no deploy'))

runs-on: ubuntu-latest

environment:
Expand All @@ -44,4 +42,4 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Deploy ZotMeet to production
run: pnpm sst deploy --stage prod
run: pnpm migrate && pnpm sst deploy --stage prod
4 changes: 2 additions & 2 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DATABASE_URL: ${{ secrets.DEV_DB_URL }}
PR_NUM: ${{ github.event.pull_request.number }}

jobs:
Expand All @@ -47,4 +47,4 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Deploy ZotMeet to staging
run: pnpm sst deploy --stage staging-$PR_NUM
run: pnpm migrate && pnpm sst deploy --stage staging-$PR_NUM
2 changes: 1 addition & 1 deletion .github/workflows/destroy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DATABASE_URL: ${{ secrets.DEV_DB_URL }}
PR_NUM: ${{ github.event.pull_request.number }}

jobs:
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"generate": "drizzle-kit generate:pg --config=drizzle.config.ts",
"postinstall": "husky install && pnpm generate && svelte-kit sync",
"lint": "eslint --quiet --fix .",
"migrate": "pnpm dlx tsx src/lib/db/migrate.ts",
"migrate": "pnpm tsx src/lib/db/migrate.ts",
"migrate:dev": "pnpm dotenv -- pnpm tsx src/lib/db/migrate.ts",
"preview": "vite preview",
"sst:deploy": "sst deploy",
"sst:dev": "sst dev",
Expand All @@ -30,12 +31,15 @@
"@lucia-auth/adapter-drizzle": "^1.0.3",
"arctic": "^1.2.1",
"clsx": "^2.1.0",
"dotenv": "^16.4.5",
"dotenv-cli": "^7.4.1",
"drizzle-orm": "0.29.4",
"lucia": "^3.1.1",
"pg": "^8.11.3",
"postgres": "3.4.3",
"svelty-picker": "^5.2.1",
"tailwind-merge": "^2.2.1",
"tsx": "^4.7.2",
"unplugin-icons": "^0.18.1"
},
"devDependencies": {
Expand All @@ -59,7 +63,6 @@
"cz-conventional-changelog": "3.3.0",
"daisyui": "^4.6.2",
"devmoji": "2.3.0",
"dotenv": "^16.4.5",
"drizzle-kit": "0.20.14",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
Expand Down
Loading
Loading