Feat(CI): Check starting the app #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and start | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build-and-start: | |
name: Run yarn build | |
runs-on: ubuntu-22.04 | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: user | |
POSTGRES_DB: codex-notes | |
POSTGRES_PASSWORD: pass | |
ports: | |
- 127.0.0.1:5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
volumes: | |
- ./database:/var/lib/postgresql/data | |
steps: | |
- name: Wait for PostgreSQL | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '20s' | |
- name: Make runner the owner of database folder | |
run: sudo chown -R user database | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: yarn install | |
- name: Build | |
run: yarn build | |
- name: Start | |
run: node dist/index.js |