Skip to content

testing

testing #8

Workflow file for this run

name: Deploy to EC2
on:
push:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to EC2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ec2-user
key: ${{ secrets.EC2_SSH_KEY }}
script: |
# Navigate to your project directory
cd /home/ec2-user/golang-project
# Pull the latest changes
git pull origin master
# Stop the current process
sudo pkill main || true
sudo fuser -k 8080/tcp || true
sleep 2
# Build the application
go build -o main cmd/api/main.go
# Start the application in the background
nohup ./main -config config/local.yaml > output.log 2>&1 &