Skip to content

Merge pull request #109 from ddxv/main #662

Merge pull request #109 from ddxv/main

Merge pull request #109 from ddxv/main #662

Workflow file for this run

name: Push-to-Server
# Trigger deployment only on push to main branch
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy to cloud on main branch push
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout the files
uses: actions/checkout@v3
- name: Deploy to server
uses: appleboy/ssh-action@master
env:
TARGETDIR: appgoblin
with:
host: ${{ secrets.HOST_DNS }}
username: ${{ vars.USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
port: 22
envs: TARGETDIR
script: |
cd $TARGETDIR
echo "Pulling latest code..."
git pull origin main
chmod +x /home/goblin/appgoblin/scripts/deploy.sh
./scripts/deploy.sh