Skip to content

Commit

Permalink
moving env declaration since env vars didn't propagate to all steps f…
Browse files Browse the repository at this point in the history
…rom where they were being set previously
  • Loading branch information
krachwal committed Jun 5, 2024
1 parent f091b2a commit b47423a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/cloud-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
END
- name: Copy Docker image to EC2 instance
env:
EC2_USERNAME: ${{ secrets.EC2_USERNAME }}
run: |
scp image.tar.gz ec2:/home/$EC2_USERNAME
Expand All @@ -71,10 +73,14 @@ jobs:
ssh ec2 'docker ps -q | xargs --no-run-if-empty docker stop | xargs --no-run-if-empty docker rm'
- name: Configure Docker & Load Image
env:
EC2_USERNAME: ${{ secrets.EC2_USERNAME }}
run: |
ssh ec2 "docker load -i /home/$EC2_USERNAME/image.tar.gz"
ssh ec2 "docker load -i /home/${EC2_USERNAME}/image.tar.gz"
- name: Delete Gzipped Image Tarball
env:
EC2_USERNAME: ${{ secrets.EC2_USERNAME }}
run: |
ssh ec2 "rm -f /home/$EC2_USERNAME/image.tar.gz"
Expand Down

0 comments on commit b47423a

Please sign in to comment.