Skip to content

feat: dsp

feat: dsp #55

Workflow file for this run

name: Preview
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
preview:
name: PR
runs-on: ubuntu-latest
environment: Preview
permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Get branch name
id: branch_name
uses: tj-actions/branch-names@v8
- name: Create Neon Branch
id: create_neon_branch
uses: neondatabase/create-branch-action@v4
with:
project_id: ${{ vars.NEON_PROJECT_ID }}
branch_name: preview/pr-${{ github.event.number }}-${{ steps.branch_name.outputs.current_branch }}
api_key: ${{ secrets.NEON_API_KEY }}
- name: Set DATABASE_URL
shell: bash
run: |
echo "DATABASE_URL=${{ steps.create_neon_branch.outputs.db_url }}?sslmode=require" >> $GITHUB_ENV
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Install Bun
uses: oven-sh/setup-bun@v1
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install dependencies
run: npx pnpm i
- name: Build
run: bun run build
- name: Generate .env file
uses: SpicyPizza/create-envfile@v2.0
with:
envkey_DATABASE_URL: ${{ env.DATABASE_URL }}
envkey_OAUTH_GITHUB_CLIENT_ID: ${{ secrets.OAUTH_GITHUB_CLIENT_ID }}
envkey_OAUTH_GITHUB_CLIENT_SECRET: ${{ secrets.OAUTH_GITHUB_CLIENT_SECRET }}
- name: Run migrations
run: bun run kysely -- migrate:latest
- name: Run tests
run: bun run test
- name: Upload coverage deno
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov-deno.info
- name: Upload coverage web
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
- name: Copy .env to .env.production
run: cp .env .env.production
- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: vasi
root: ""
include: .env.production,api,dist
entrypoint: ./api/core/server.ts
import-map: ./api/import-map.production.json