Skip to content

Commit 4e77506

Browse files
author
Michał Miszczyszyn
authored
Update pm2 (#42)
* Update * Remove tslint from pre-commit
1 parent 861aa46 commit 4e77506

File tree

5 files changed

+53
-46
lines changed

5 files changed

+53
-46
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@ name: Deploy
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66

77
jobs:
8-
build:
8+
deploy:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
13-
14-
15-
- name: Run a command remotely
16-
run: |
17-
mkdir -p ~/.ssh/
18-
echo "$SSH_PRIVATE_KEY" > ../private.key
19-
sudo chmod 600 ../private.key
20-
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
21-
ssh -i ../private.key typeofweb@s18.mydevil.net 'source ~/.bashrc && ssh-add ~/.ssh/github && bash -s' < ./ssh-script-deploy.sh
22-
shell: bash
23-
env:
24-
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
25-
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
12+
- uses: actions/checkout@v2
13+
14+
- name: Setup SSH Keys and known_hosts
15+
env:
16+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
17+
run: |
18+
mkdir -p ~/.ssh
19+
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
20+
ssh-keyscan -H s18.mydevil.net >> ~/.ssh/known_hosts
21+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
22+
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
23+
ssh typeofweb@s18.mydevil.net 'source ~/.bashrc && ssh-add ~/.ssh/github && bash -s' < ./ssh-script-deploy.sh

.github/workflows/nodejs.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Run tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- name: Read .nvmrc
16+
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
17+
id: nvm
18+
- name: Use Node.js
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: '${{ steps.nvm.outputs.NVMRC }}'
22+
23+
- name: Cache Node.js modules
24+
uses: actions/cache@v1
25+
with:
26+
path: ~/.npm
27+
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.OS }}-node-
30+
${{ runner.OS }}-
31+
32+
- name: npm install, and test
33+
run: |
34+
npm ci
35+
npm run test:ci
36+
env:
37+
CI: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
},
6565
"husky": {
6666
"hooks": {
67-
"pre-commit": "npm run tslint && pretty-quick --staged"
67+
"pre-commit": "pretty-quick --staged"
6868
}
6969
}
7070
}

ssh-script-deploy.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ echo `git rev-parse HEAD` > .version
2828
# npm prune
2929

3030
echo "👉 Restarting the server…"
31-
devil www restart bot.typeofweb.com
32-
curl -I bot.typeofweb.com
31+
pm2 restart bot
3332

3433
echo "👉 Done! 😱 👍"

0 commit comments

Comments
 (0)