Skip to content

Deploy - Staging

Deploy - Staging #563

name: Deploy - Staging
on:
push:
branches: [master]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ./deploy.key
sudo chmod 600 ./deploy.key
ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts
shell: bash
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_MACHINE_USER_PRIVATE_KEY}}
SSH_HOST: ${{ secrets.SSH_HOST_STAGING }}
- name: Deploy to staging
run: ssh -i ./deploy.key www-data@$SSH_HOST 'sh /opt/apps/www/www-deploy.sh'
env:
SSH_HOST: ${{ secrets.SSH_HOST_STAGING }}