Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
petriichuk committed Dec 9, 2023
1 parent 399e614 commit 531c95f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,21 @@ jobs:
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
- name: Pull And Run
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_REMOTE_URI: ${{ steps.login-ecr.outputs.registry }}/django-images
run: |
echo "${{ secrets.SSH_KEY }}" > dev.key
chmod 600 dev.key
scp -i dev.key -o StrictHostKeyChecking=no docker-compose.deploy.yml ec2-user@${{ secrets.INSTANCE_IP_ADDRESS }}:./
ssh -i dev.key -o StrictHostKeyChecking=no ec2-user@${{ secrets.INSTANCE_IP_ADDRESS }} << 'ENDSSH'
ls
aws configure set aws_access_key_id "${{ secrets.AWS_ACCESS_KEY_ID }}"
aws configure set aws_secret_access_key "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
aws configure set region "eu-west-1"
aws configure set output "text"
aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin ${{ env.ECR_REGISTRY }}
docker pull ${{ env.IMAGE_REMOTE_URI }}:latest
ENDSSH

0 comments on commit 531c95f

Please sign in to comment.