Skip to content

Merge pull request #20 from stagas/dsp #72

Merge pull request #20 from stagas/dsp

Merge pull request #20 from stagas/dsp #72

Workflow file for this run

name: Deploy
on:
push:
branches: main
jobs:
deploy:
name: Production
runs-on: ubuntu-latest
environment: Production
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: 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: Uninstall dev deps with scripts
run: npm remove @vite-pwa/assets-generator --force --ignore-scripts=true
- name: Install dependencies
run: npm i --force --ignore-scripts=true
- name: Install dev deps with scripts
run: npm i @vite-pwa/assets-generator -D --force
- name: Build
run: bun run build
- name: Generate .env file
uses: SpicyPizza/create-envfile@v2.0
with:
envkey_DATABASE_URL: ${{ secrets.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