From 78c053816b73ed5a13e20644d46af0630cfcd186 Mon Sep 17 00:00:00 2001 From: ClementMabileau Date: Thu, 21 Mar 2024 23:33:25 +0100 Subject: [PATCH] Deploy on manually triggered workflows (#35) * Trigger deployment on manually triggered workflows * Skip notify job when event is workflow_dispatch: unsupported --- .github/workflows/build_and_deploy.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 1095fed..acd0ee6 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -39,10 +39,10 @@ jobs: path: ./build/blog # Deployment job: heavily inspired from https://swharden.com/blog/2022-03-20-github-actions-hugo/ - # /!\ only triggers on push events + # /!\ only triggers on push events and manually triggered deploy: needs: [build] - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-latest steps: - name: 🛠️ Setup build directory @@ -73,8 +73,10 @@ jobs: rsync --archive --stats --verbose --delete ./build/blog/* ${{ secrets.CI_USER_NAME }}@iscsc.fr:${{ secrets.STATIC_WEBSITE_PATH}} # Finally notify of the new article (if any) on the iScsc discord server + # action jitterbit/get-changed-files@v1 doesn't support 'workflow_dispatch' events: https://github.com/jitterbit/get-changed-files/issues/38 notify: needs: [deploy] + if: ${{ github.event_name != 'workflow_dispatch' }} runs-on: ubuntu-latest steps: # Checkout repo, no need to checkout submodule