implement ci #4
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 EC2 | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install SSH key | |
uses: webfactory/ssh-agent@v0.5.3 | |
with: | |
ssh-private-key: ${{ secrets.EC2_SSH_KEY }} | |
- name: Deploy project | |
run: | | |
scp -r dist/* ubuntu@18.216.36.138:/usr/share/nginx/html/ | |
ssh ubuntu@18.216.36.138 sudo systemctl restart nginx |