From 5a6f1160924a68d4ad8d7f39a4159f4560412ffd Mon Sep 17 00:00:00 2001 From: Miguel Puerta Date: Mon, 18 Dec 2023 12:38:26 +0100 Subject: [PATCH] feat: adds restart option selection in deploy workflow --- .github/workflows/deploy.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 11265e4..8754fa2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,6 +13,10 @@ on: description: Deploy enviroment options: - PRODUCTION + restart_app: + type: boolean + default: true + description: Restart app jobs: deploy: @@ -32,6 +36,9 @@ jobs: - name: Build hugo run: hugo - name: ${{ github.event.inputs.deploy_env }} app restart - run: pm2 restart BLOG --log-date-format 'DD-MM-YYYY HH:mm:ss' + run: | + if [ ${{ github.event.inputs.restart_app }} == true ]; then + pm2 restart BLOG --log-date-format 'DD-MM-YYYY HH:mm:ss' + fi - name: Notify deployment run: DEPLOY_ENV=${{ github.event.inputs.deploy_env}} NTFY_USER=${{ secrets.NTFY_USER }} NTFY_PASSWD=${{ secrets.NTFY_PASSWD }} NTFY_SERVER_URL=${{ secrets.NTFY_SERVER_URL }} PROJECT_NAME=${{ vars.PROJECT_NAME }} npm run notify:deploy