Skip to content

modified: README.md #63

modified: README.md

modified: README.md #63

Workflow file for this run

on:
push:
branches:
- main
workflow_dispatch:
jobs:
run_pull:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: install ssh keys
# check this thread to understand why its needed:
# https://stackoverflow.com/a/70447517
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect and pull
run: rsync -r --delete ${{ github.workspace }}/html ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.WORK_DIR }}
- name: cleanup
run: rm -rf ~/.ssh