Skip to content

Commit

Permalink
🚀 deploy config update
Browse files Browse the repository at this point in the history
Related:
  • Loading branch information
L-U-Ready committed Nov 11, 2024
1 parent 69ab6da commit 1ac2ba1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
run: |
echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Connect to EC2 and deploy
uses: appleboy/ssh-action@master
with:
Expand All @@ -56,19 +57,19 @@ jobs:
# Install Docker if not installed
if ! command -v docker &> /dev/null; then
echo "Installing Docker..."
sudo apt update
sudo apt install -y docker.io
sudo yum update -y
sudo amazon-linux-extras install docker -y
sudo systemctl start docker
sudo usermod -aG docker ec2-user
fi
# Install Docker Compose if not installed
if ! command -v docker-compose &> /dev/null; then
echo "Installing Docker Compose..."
sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name | cut -d '\"' -f 4)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
fi
echo "Stopping and removing any existing application container..."
docker-compose -f /home/ec2-user/your_project_folder/docker-compose.yml down || true
echo "Pulling the latest Docker image..."
Expand Down

0 comments on commit 1ac2ba1

Please sign in to comment.