Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ssh -o StrictHostKeyChecking=no azureuser@40.82.162.21 <<HTML

cd /home/azureuser/learning-github-actions
git pull origin main

HTML
23 changes: 23 additions & 0 deletions .github/workflows/workflow-azure-vm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Workflow for Azure VM
permissions:
contents: read
on: workflow_dispatch

jobs:
connect-to-azure-vm:
runs-on: ubuntu-latest
steps:
- name: "Checkout Github Action"
uses: actions/checkout@v4

- name: "Setup SSH agent"
uses: "webfactory/ssh-agent@v0.9.0"
with:
ssh-private-key: ${{ secrets.AZURE_SSH_PRIVATE_KEY }}

- name: "Run commands on Azure VM"
run: |
ssh -o StrictHostKeyChecking=no azureuser@40.82.162.21 touch hello.txt

- name: "Run deploy script on Azure VM"
run: bash .github/scripts/deploy.sh
Comment thread Fixed
Loading