GithubHelp home page GithubHelp logo

nshen / gha-publish-to-git Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seanmiddleditch/gha-publish-to-git

0.0 2.0 0.0 11 KB

GitHub Action to publish files to a git repo

License: MIT License

Dockerfile 3.79% Shell 96.21%

gha-publish-to-git's Introduction

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

  • repository: Destination repository (default: current repository).
  • branch: Destination branch (required).
  • host: Destination git host (default: github.com).
  • github_token: GitHub Token (required; use secrets.GITHUB_TOKEN).
  • github_pat: Personal Access Token or other https credentials.
  • source_folder: Source folder in workspace to copy (default: workspace root).
  • target_folder: Target folder in destination branch to copy to (default: repository root).
  • commit_author: Override commit author (default: {github.actor}@users.noreply.github.com).
  • commit_message: Set commit message (default: [workflow] Publish from [repository]:[branch]/[folder]).
  • dry_run: Does not push if non-empty (default: empty).
  • working_directory: Location to checkout repository (default: random location in ${HOME})

Outputs

  • commit_hash: SHA hash of the new commit.
  • working_directory: Working directory of git clone of repository.

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'

gha-publish-to-git's People

Contributors

nshen avatar seanmiddleditch avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.