Skip to content

Commit

Permalink
fix: workflow steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefanie-A committed Oct 14, 2024
1 parent ba67557 commit e4bcc1e
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,15 @@ jobs:
Deployment:
runs-on: ubuntu-latest
steps:
- name: Write SSH key to file
run: |
echo "${{ secrets.EC2_KEY }}" | tr -d '\r' > ~/ec2_key.pem
- name: Set SSH key permissions
run: chmod 600 ~/ec2_key.pem

# SSH into the EC2 instance and run your deployment commands
- name: checkout code
uses: actions/checkout@v4
- name: SSH into EC2 and run deployment
run: |
ssh -o StrictHostKeyChecking=no -i ~/ec2_key.pem ec2-user@${{ secrets.EC2_HOST }} << 'EOF'
sudo apt update -y
sudo apt install docker.io -y
sudo apt install docker-compose-plugin -y
docker pull stefnie/api-image:latest
docker pull stefnie/uri-image:latest
docker-compose -f /path/to/compose.yaml up -d
EOF
# - name: checkout code
# uses: actions/checkout@v4
# - name: SSH into EC2 and run deployment
# run: |
# ssh -i ${{ secrets.EC2_KEY }} ec2-user@${{ secrets.EC2_HOST }}
# sudo apt update -y
# sudo apt install docker.io -y
# sudo apt install docker-compose-plugin
# docker pull stefnie/api-image:latest
# docker pull stefnie/uri-image:latest
# docker-compose -f compose.yaml up -d
ssh -i ${{ secrets.EC2_KEY }} ec2-user@${{ secrets.EC2_HOST }}
sudo apt update -y
sudo apt install docker.io -y
sudo apt install docker-compose-plugin
docker pull stefnie/api-image:latest
docker pull stefnie/uri-image:latest
docker-compose -f compose.yaml up -d

0 comments on commit e4bcc1e

Please sign in to comment.