Skip to content

Commit

Permalink
Merge pull request #2 from vhpx/main
Browse files Browse the repository at this point in the history
chore: verify supabase migration workflow
  • Loading branch information
vhpx authored Apr 15, 2024
2 parents 8e5d734 + e25f46f commit 34659a3
Show file tree
Hide file tree
Showing 8 changed files with 2,473 additions and 10 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/supabase-production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Supabase CI

on:
push:
branches:
- production
workflow_dispatch:

jobs:
deploy:
name: Migrate production database
timeout-minutes: 15
runs-on: ubuntu-latest

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.PRODUCTION_DB_PASSWORD }}
PRODUCTION_PROJECT_ID: ${{ secrets.PRODUCTION_PROJECT_ID }}

steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1

- name: Deploy migrations to production
run: |
cd apps/web
supabase link --project-ref ${{ env.PRODUCTION_PROJECT_ID }}
supabase db push
38 changes: 38 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test

on:
push:
branches: ["main", "production"]
pull_request:
types: [opened, synchronize]

jobs:
build:
name: Automated Tests
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: pnpm/action-setup@v3
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Test
run: pnpm test
7 changes: 7 additions & 0 deletions __tests__/verify-setup.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, expect, test } from "vitest";

describe("Verify test setup", () => {
test("vitest should be working", () => {
expect(true).toBe(true);
});
});
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
"start": "next start",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"@supabase/ssr": "latest",
"@supabase/supabase-js": "latest",
"autoprefixer": "10.4.17",
"geist": "^1.2.1",
"autoprefixer": "10.4.19",
"geist": "^1.3.0",
"next": "latest",
"postcss": "8.4.33",
"postcss": "8.4.38",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.4.1",
"typescript": "5.3.3"
"tailwindcss": "3.4.3"
},
"devDependencies": {
"@types/node": "20.11.5",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"encoding": "^0.1.13"
"@types/node": "20.12.7",
"@types/react": "18.2.78",
"@types/react-dom": "18.2.25",
"encoding": "^0.1.13",
"supabase": "^1.157.2",
"typescript": "^5.4.5",
"vitest": "^1.5.0"
}
}
Loading

1 comment on commit 34659a3

@vercel
Copy link

@vercel vercel bot commented on 34659a3 Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.