Add PM2 deployment config #27
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: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
cache-dependency-path: "pnpm-lock.yaml" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
continue-on-error: true | |
- name: Set up config files | |
run: cp config/config.example.toml config/config.toml | |
- name: Build | |
run: pnpm build | |
continue-on-error: true | |
- name: Test | |
run: | | |
pnpm start & | |
sleep 5 | |
curl -sSf http://localhost:3000 | |
- name: Set up SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Install PM2 | |
run: pnpm install -g pm2 | |
- name: Deploy | |
run: pnpm run deploy |