diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index d5afe64..045cc66 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -19,11 +19,11 @@ jobs: with: node-version: 16 cache: 'npm' - - run: npm install - - run: npm run build - run: mkdir ~/.ssh - run: 'echo "$SSH_KEY" >> ~/.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: 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" diff --git a/package.json b/package.json index abc1215..afd5e8c 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "deploy:prod": "rsync -avz --progress build/ ifsalas:/home/ifsalas/web/prod" }, "eslintConfig": { "extends": [