From 5a7c99b532e9251763ad458698d325591bd1d918 Mon Sep 17 00:00:00 2001 From: Leandro Facchinetti Date: Tue, 4 Aug 2020 22:47:58 +0100 Subject: [PATCH] . --- .github/workflows/main.yml | 2 +- .vscode/tasks.json | 2 +- Dockerfile | 2 +- README.md | 2 +- package.json | 9 ++++++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b614598..7cd69c7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,5 +12,5 @@ jobs: with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} if: github.ref == 'refs/heads/master' - - run: npx pm2 deploy package.json production + - run: npm run deploy if: github.ref == 'refs/heads/master' diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a3ca593..396c77d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -5,7 +5,7 @@ "tasks": [ { "type": "npm", - "script": "start", + "script": "develop", "group": { "kind": "build", "isDefault": true diff --git a/Dockerfile b/Dockerfile index 83d149d..35973f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,4 @@ ENV ISSUE_REPORT=mailto:kill-the-newsletter@leafac.com EXPOSE 8000 EXPOSE 2525 -CMD npx ts-node . +CMD npm start diff --git a/README.md b/README.md index 4e9115d..3b1f4ce 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ ```console $ ssh-add - $ npx pm2 deploy package.json production setup + $ npm run deploy:setup ``` 12. Migrate the existing feeds (if any): diff --git a/package.json b/package.json index cdd1152..b1077be 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,10 @@ { "scripts": { - "start": "open-cli http://localhost:8000 && nodemon --ext ts --exec 'ts-node .'", - "test": "prettier --check '**/*.{ts,css}' && jest" + "start": "ts-node .", + "develop": "open-cli http://localhost:8000 && nodemon --ext ts --exec 'ts-node .'", + "test": "prettier --check '**/*.{ts,css}' && jest", + "deploy": "pm2 deploy package.json production", + "deploy:setup": "pm2 deploy package.json production setup" }, "dependencies": { "@types/express": "^4.17.3", @@ -44,7 +47,7 @@ "apps": [ { "name": "kill-the-newsletter", - "script": "ts-node .", + "script": "npm start", "env": { "NODE_ENV": "production", "WEB_PORT": "8000",