Restart Nginx #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |