Skip to content

'workflow_dispatch' trigger for peaceiris/action-gh-pages? #4

Open

Description

@mmesiti

I wonder if the 'if' clause in the step

      - name: Deploy to GitHub Pages                                            
        uses: peaceiris/actions-gh-pages@v3                                     
        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
        with:                                                                   
          publish_branch: gh-pages                                              
          github_token: ${{ secrets.GITHUB_TOKEN }}                             
          publish_dir: _build/                                                  
          force_orphan: true           

should not be instead

        if: ${{ ( github.event_name == 'push' || github.even_name == 'workflow_dispatch' ) && github.ref == 'refs/heads/main' }}

The reason is that the workflow "documentation.yml" can be started manually (because of on: [push, pull_request, workflow_dispatch]) but in that case the action that regenerates the gh-pages branch will not be executed.

I think I've seen this in one case. Does it make sense?

Activity

  1. bast commented on Mar 29, 2025

    @bast
    Member

    Thanks! This makes sense. Until today I did not know and did not check what "workflow_dispatch" really meant.

  2. rkdarst commented on Mar 31, 2025

    @rkdarst
    Member

    Makes perfect sense to me. I have rarely used workflow_dispatch so I don't often think of it (even though I should more).

    I've also updated our main lessons to support workflow_dispatch - but it will take time to get deployed everywhere, maybe best not to do this during an active workshop.

  3. mmesiti commented on Apr 1, 2025

    @mmesiti
    ContributorAuthor

    I'll make a PR at some point then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions