Skip to content

Commit

Permalink
Update Back-build.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
seung-jun2 authored Jul 9, 2024
1 parent ba14020 commit 9b1f3ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/Back-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ jobs:
run: docker save -o my-app.tar my-app:latest

- name: Upload Docker Image to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws s3 cp my-app.tar s3://trendy-healthy-backend.store/my-app.tar

- name: Deploy Docker Image to EC2
env:
SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
EC2_HOST: ${{ secrets.EC2_HOST }}
EC2_USER: ${{ secrets.EC2_USER }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
# SSH into EC2 instance and deploy the Docker image
ssh -i <(echo "$SSH_PRIVATE_KEY") $EC2_USER@$EC2_HOST << 'EOF'
Expand Down

0 comments on commit 9b1f3ae

Please sign in to comment.