Skip to content

Deploy - Production #306

Deploy - Production

Deploy - Production #306

name: Deploy - Production
on:
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_PRODUCTION }}
- name: Deploy to production
run: ssh -i ./deploy.key www-data@$SSH_HOST 'sh /opt/apps/www/www-deploy.sh'
env:
SSH_HOST: ${{ secrets.SSH_HOST_PRODUCTION }}