Improve and fix deploy to prod

This commit is contained in:
Leonardo Murça 2022-09-22 10:48:46 -03:00
parent 4685ba6876
commit 7da7c0841a
2 changed files with 5 additions and 4 deletions

View file

@ -19,11 +19,11 @@ jobs:
with: with:
node-version: 16 node-version: 16
cache: 'npm' cache: 'npm'
- run: npm install
- run: npm run build
- run: mkdir ~/.ssh - run: mkdir ~/.ssh
- run: 'echo "$SSH_KEY" >> ~/.ssh/id_ed25519_ifsalas' - run: 'echo "$SSH_KEY" >> ~/.ssh/id_ed25519_ifsalas'
- run: chmod 400 ~/.ssh/id_ed25519_ifsalas - run: chmod 400 ~/.ssh/id_ed25519_ifsalas
- run: echo -e "Host ifsalas\n\tUser ifsalas\n\tHostname 45.76.5.44\n\tIdentityFile ~/.ssh/id_ed25519_ifsalas\n\tStrictHostKeyChecking No" >> ~/.ssh/config - run: echo -e "Host ifsalas\n\tUser ifsalas\n\tHostname 45.76.5.44\n\tIdentityFile ~/.ssh/id_ed25519_ifsalas\n\tStrictHostKeyChecking No" >> ~/.ssh/config
- run: rsync -rLtvz build/ ifsalas:/home/ifsalas/web/prod - run: npm install
- run: npm run build
- run: npm run deploy:prod
- run: ssh ifsalas "pm2 reload all" - run: ssh ifsalas "pm2 reload all"

View file

@ -25,7 +25,8 @@
"start": "react-scripts start", "start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject" "eject": "react-scripts eject",
"deploy:prod": "rsync -avz --progress build/ ifsalas:/home/ifsalas/web/prod"
}, },
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [