Skip to content

Commit

Permalink
Deploy on manually triggered workflows (#35)
Browse files Browse the repository at this point in the history
* Trigger deployment on manually triggered workflows

* Skip notify job when event is workflow_dispatch: unsupported
  • Loading branch information
ctmbl authored Mar 21, 2024
1 parent c5774c1 commit 78c0538
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 78c0538

Please sign in to comment.