diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..16d0745 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: Preview Deploy + +on: + push: + branches: + - main + +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Install dependencies + run: bun install --frozen-lockfile + - name: Run build + run: bun run build + - name: Typcheck + run: bun run check + - name: Deploy to Vercel + working-directory: ./www + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..8bdd466 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,31 @@ +name: Preview Deploy + +on: + push: + branches-ignore: + - main + +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Install dependencies + run: bun install --frozen-lockfile + - name: Run build + run: bun run build + - name: Typcheck + run: bun run check + - name: Deploy to Vercel + working-directory: ./www + run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/tests.yml similarity index 64% rename from .github/workflows/ci.yml rename to .github/workflows/tests.yml index d10eaca..1a097e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: CI +name: Run tests on: push: @@ -11,14 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v2 + - name: Setup bun + uses: oven-sh/setup-bun@v2 with: bun-version: latest - name: Install dependencies run: bun install --frozen-lockfile - - name: Run build - run: bun run build - - name: Typcheck - run: bun run check - name: Running tests - run: bun test + run: bun test --affected