Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hangtantai committed Nov 26, 2024
1 parent 1dac168 commit 5991f68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@ jobs:
run: |
docker save my-backend:latest -o my-backend.tar
- name: Add SSH key
run: |
echo "${{ secrets.VM_SSH_KEY }}" > /tmp/vm_ssh_key
chmod 600 /tmp/vm_ssh_key
- name: Copy Docker image to VM
uses: appleboy/scp-action@v0.1.1
with:
host: ${{ secrets.VM_HOST }}
username: ${{ secrets.VM_USERNAME }}
key: ${{ secrets.VM_SSH_KEY }}
key: /tmp/vm_ssh_key
source: "my-backend.tar"
target: "/home/azureuser/docker-images/my-backend.tar"

- name: Load Docker image on VM
run: |
ssh -i ${{ secrets.VM_SSH_KEY }} ${{ secrets.VM_USERNAME }}@${{ secrets.VM_HOST }} 'docker load -i /home/azureuser/docker-images/my-backend.tar'
ssh -i /tmp/vm_ssh_key ${{ secrets.VM_USERNAME }}@${{ secrets.VM_HOST }} 'docker load -i /home/azureuser/docker-images/my-backend.tar'
2 changes: 1 addition & 1 deletion hello-world.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
print("Hello-world")
print("___")
print("")
print("H")
print("HH")

0 comments on commit 5991f68

Please sign in to comment.