Skip to content

Merge pull request #92 from Sandile-Dev01/sandile-dev01 #203

Merge pull request #92 from Sandile-Dev01/sandile-dev01

Merge pull request #92 from Sandile-Dev01/sandile-dev01 #203

Workflow file for this run

name: Deploy To Production
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
prod:
runs-on: ubuntu-latest
steps:
- name: Install SSH Key.
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.PROD_SSH_KEY }}
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'
- name: Adding our IP to known hosts.
run: ssh-keyscan -p ${{ secrets.PROD_SSH_PORT }} -H ${{ secrets.PROD_SSH_IP }} >> ~/.ssh/known_hosts
- name: Restart service that automatically pulls from Git and deploys application in Docker container via Docker Compose (started with deaconn systemctl service).
run: ssh ${{ secrets.PROD_SSH_USER }}@${{ secrets.PROD_SSH_IP }} -p ${{ secrets.PROD_SSH_PORT }} sudo systemctl restart deaconn