Skip to content

test5555

test5555 #13

Workflow file for this run

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: actions/checkout@v2
- name: Create Tar Archive
run: tar -czf deploy.tar.gz .
- name: Copy Tar Archive to Ubuntu Server
uses: appleboy/ssh-action@v1.0
with:
host: ${{ secrets.HOST_DNS }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
scp -o StrictHostKeyChecking=no deploy.tar.gz ${{ secrets.USERNAME }}@${{ secrets.HOST_DNS }}:/home
- name: Extract Tar Archive on Ubuntu Server
uses: appleboy/ssh-action@v2
with:
host: ${{ secrets.HOST_DNS }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd /home
tar -xzf deploy.tar.gz