Update main.yml #5
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: Deploy to Server | |
on: | |
push: | |
branches: | |
- original # Change to your branch | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Add GitHub to known_hosts | |
run: | | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
- name: Execute remote commands | |
run: | | |
ssh -o StrictHostKeyChecking=no [email protected] << 'EOF' | |
cd rantir-cloud-go | |
git pull origin original | |
yarn build | |
yarn nocobase pm2-stop | |
yarn start -d | |
EOF |