Skip to content

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

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

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