Skip to content

Merge pull request #34 from codeHack-s/LastCodehack #44

Merge pull request #34 from codeHack-s/LastCodehack

Merge pull request #34 from codeHack-s/LastCodehack #44

Workflow file for this run

name: Deploy to My Server
on:
push:
branches:
- main # default branch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH and deploy
env:
PRIVATE_KEY: ${{ secrets.SERVER_SSH_PRIVATE_KEY }}
HOST: ${{ secrets.SERVER_HOST }}
USERNAME: ${{ secrets.SERVER_USERNAME }}
run: |
echo "$PRIVATE_KEY" > private_key.pem
chmod 600 private_key.pem
ssh -o StrictHostKeyChecking=no -i private_key.pem $USERNAME@$HOST "/opt/scripts/deploy.sh"