Update contact information across components #17
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: NPH Digital Deployment | |
on: | |
push: | |
branches: | |
- master | |
- nphdigital.vn | |
jobs: | |
deploy-com: | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to nphdigital.com | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
port: 22 | |
script: | | |
cd /var/www/nphdigital/nphdigital.com/nphdigital | |
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S -v | |
if [ $? -eq 0 ]; then | |
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S git pull origin master | |
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S npm run build | |
pm2 reload 0 | |
pm2 restart 0 | |
else | |
echo "Mật khẩu sudo không chính xác." | |
exit 1 | |
fi | |
deploy-vn: | |
if: github.ref == 'refs/heads/nphdigital.vn' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to nphdigital.vn | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
port: 22 | |
script: | | |
cd /var/www/nphdigital/nphdigital.vn/nphdigitalvn | |
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S -v | |
if [ $? -eq 0 ]; then | |
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S git pull origin nphdigital.vn | |
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S npm run build | |
pm2 reload 1 | |
pm2 restart 1 | |
else | |
echo "Mật khẩu sudo không chính xác." | |
exit 1 | |
fi |