Update azure-deploy.yml #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Azure | |
on: | |
push: | |
branches: | |
- main # Adjust to your main branch | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 # or ubuntu-22.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up SSH | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.AZURE_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
echo "${{ secrets.AZURE_PUBLIC_KEY }}" > ~/.ssh/id_rsa.pub | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan -H 13.84.184.169 >> ~/.ssh/known_hosts | |
- name: Deploy to Azure | |
run: | | |
ssh svc_mwc@13.84.184.169 << 'EOF' | |
cd /path/to/your/project | |
git pull origin main | |
./restart_script.sh | |
EOF |