seanmiddleditch / gha-publish-to-git

GitHub Action to publish files to a git repo
MIT License
25 stars 24 forks source link

publish-to-git

GitHub Action for publishing a directory and its contents to another git repository.

This can be especially useful for publishing static website, such as with GitHub Pages, from built files in other job steps, such as Doxygen generated HTML files.

NOTE: GitHub currently requires the use of a Personal Access Token for pushing to other repositories. Pushing to the current repository should work with the always-available GitHub Token (available via {{ secrets.GITHUB_TOKEN }}. If pushing to another repository, a Personal Access Token will need to be created and assigned to the workflow secrets.

Inputs

Outputs

License

MIT License. See LICENSE for details.

Usage Example

jobs:
  publish:
    - uses: actions/checkout@master
    - run: |
        sh scripts/build-doxygen-html.sh --out static/html
    - uses: seanmiddleditch/gha-publish-to-git@master
      with:
        branch: gh-pages
        github_token: '${{ secrets.GITHUB_TOKEN  }}'
        github_pat: '${{ secrets.GH_PAT }}'
        source_folder: static/html
      if: success() && github.event == 'push'