Skip to content

Merge pull request #257 from wikitongues/staging #37

Merge pull request #257 from wikitongues/staging

Merge pull request #257 from wikitongues/staging #37

name: Deploy to Production
on:
push:
branches:
- production
workflow_dispatch:
env:
REMOTE_DIR: ./public_html/
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 -e "ssh -o StrictHostKeyChecking=no" --filter='merge .rsync-filter' . ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ env.REMOTE_DIR }}
- name: Clean up known hosts
run: rm -f ~/.ssh/known_hosts