Merge pull request #24 from tunglambg131003/development #9
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: Auto deployment to production server | |
on: | |
push: | |
branches: | |
- product | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Deploy to Product server | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup SSH KEY | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SSH_PRIVATE_DEPLOYMENT_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts | |
- name: Deploy to Product | |
run: | | |
ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -p 22 root@${{ secrets.SERVER_IP }} "cd /root/MedDict/COMP2030_Meddict && git pull origin product && chmod +x ./deploy.sh && ./deploy.sh" | |
echo "Deployed Successfully" |