Skip to content

Restart Nginx

Restart Nginx #15

Workflow file for this run

name: Restart Nginx
on:
workflow_dispatch:
workflow_run:
workflows: ["Build Angular Project", "Nginx Update workflow"]
types:
- completed
jobs:
restart:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Restart Nginx
run: |
ssh-keyscan -H ${{ secrets.HOST }} >> ~/.ssh/known_hosts
ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} 'docker restart NGINX'