Skip to content

Merge pull request #109 from wikitongues/staging #5

Merge pull request #109 from wikitongues/staging

Merge pull request #109 from wikitongues/staging #5

name: Deploy to Production
on:
push:
branches:
- production
env:
REMOTE_DIR: ./public_html/wp-content/themes/blankslate-child
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install rsync
run: sudo apt-get install -y rsync
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add server to known hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Deploy via rsync
run: rsync -avz --delete -e "ssh -o StrictHostKeyChecking=no" . ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ env.REMOTE_DIR }}
- name: Clean up known hosts
run: rm -f ~/.ssh/known_hosts