Skip to content

add deploy script

add deploy script #1

Workflow file for this run

name: Deploy on master merge
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
deploy:
runs-on: ubuntu-latest
env:
DEPLOY_SERVER: 193.2.72.46
DEPLOY_USER: notes-deploy-user
steps:
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_NOTES_DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H $DEPLOY_SERVER >> ~/.ssh/known_hosts
- name: Trigger deploy script over SSH
run: |
ARGS=""
if [ "${{ github.event_name }}" = "pull_request" ]; then
ARGS="${{ github.head_ref }}"
fi
ssh -o StrictHostKeyChecking=yes $DEPLOY_USER@$DEPLOY_SERVER "${{ github.repository }}" $ARGS