Skip to content

Attribute gh-pages to github-actions bot #176

@cyschneck

Description

@cyschneck

By default, the deployment of github-pages is authored by the github account that created the original repo. So accounts get a lot of "ghost" commits each day and any changes to the email/account will prevent gh-pages from running

It appears as though JamesIves/github-pages-deploy-action has an option to set git-config-name and git-config-email to the github actions bot to prevent this

So it would change (in deploy-book.yaml) from:

      - name: Deploy to GitHub Pages
        uses: JamesIves/github-pages-deploy-action@v4
        if: |
          (github.ref == 'refs/heads/main')
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          branch: gh-pages
          folder: ${{ inputs.publish_dir }}
          clean: true
          clean-exclude: _preview/*  # keep existing previews from other PRs
          target-folder: ${{ inputs.destination_dir }}

To:

      - name: Deploy to GitHub Pages
        uses: JamesIves/github-pages-deploy-action@v4
        if: |
          (github.ref == 'refs/heads/main')
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          git-config-name: 'github-actions[bot]'
          git-config-email: 'github-actions[bot]@users.noreply.github.com'
          branch: gh-pages
          folder: ${{ inputs.publish_dir }}
          clean: true
          clean-exclude: _preview/*  # keep existing previews from other PRs
          target-folder: ${{ inputs.destination_dir }}

(See a similar change NCAR/geocat-applications#287 for an example that runs a similar automated deployment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    infrastructureInfrastructure related issue

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions