Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

fix: build project to deploy #3

fix: build project to deploy

fix: build project to deploy #3

Workflow file for this run

name: Deploy to Caprover
permissions: read-all
on:
push:
branches: main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm run test --if-present
- uses: a7ul/tar-action@v1.1.0
with:
command: c
cwd: './'
files: |
dist/
captain-definition
outPath: deploy.tar
- name: Deploy to CapRrover
uses: caprover/deploy-from-github@v1.1.2
with:
server: '${{ secrets.CAPROVER_SERVER }}'
app: trending
token: '${{ secrets.CAPROVER_TOKEN }}'
migrations:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.4
- name: install dependencies
run: npm ci
- name: run migrations
run: npm run db:migrate:prod
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}