ip updating #18
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 Ubuntu Server1 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Deploy to Ubuntu Server | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: appleboy/ssh-action@v1.0.0 | |
- name: Create Tar Archive | |
run: tar -czf deploy.tar.gz . | |
- name: Copy Tar Archive to Ubuntu Server | |
uses: appleboy/ssh-action@v1.0.0 | |
with: | |
host: ${{ secrets.IP }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.EC2_SSH_KEY }} | |
script: | | |
scp -o StrictHostKeyChecking=no deploy.tar.gz ${{ secrets.USERNAME }}@${{ secrets.IP }}:/home | |
- name: Extract Tar Archive on Ubuntu Server | |
uses: appleboy/ssh-action@v1.0.0 | |
with: | |
host: ${{ secrets.IP }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.EC2_SSH_KEY }} | |
script: | | |
cd /home | |
tar -xzf deploy.tar.gz |