{"repo":"s0/git-publish-subdir-action","free":true,"listed":false,"github":"https://github.com/s0/git-publish-subdir-action","clone":"git clone https://github.com/s0/git-publish-subdir-action.git","description":"GitHub Action to push a subdirectory as a branch to any git repo (e.g. for GitHub Pages)","language":"TypeScript","stars":234,"topics":["github-actions","ssh","git","github","actions","github-pages"],"license":"MIT","category":"workflow-automation","readme_excerpt":"GitHub Action: Push git subdirectory as branch This GitHub Action will take any subdirectory in your repository, and push it as the contents of a git branch to a repository and branch of your choosing, either over SSH or to the current repo. You could use this for example to: Publishing a subdirectory to a repo's gh-pages branch, after optionally running a build step. Publishing build artifacts / binaries to another repository The target repository can be anywhere accessible by a Git SSH URL (or the current repository). If the target branch doesn't exist yet, it will be created automatically. Usage Simply include the action s0/git-publish-subdir-action@develop in the appropriate point in your workflow, and pass in the required configuration options: Examples When pushed to master, push /public/site to the gh-pages branch on the same repo When pushed to master, push the contents of /public/site to the www folder on the gh-pages branch on the same repo When pushed to master, run a build step, then push /build to the gh-pages branch on another repo on GitHub Note: the SSH Key needs to have write access to the given repo. It's recommended you use Deploy Keys for this (see below), and store the SSH private key as as Secret in the repository settings. When pushed to master, run a build step, then push /dist to the artifacts branch on a repo hosted at mydomain.com You can generate a known hosts file for a given domain by using ssh-keyscan , e.g: Configuration All configuration optio","default_branch":null,"files":null,"tree":[],"storefront":"/r/s0","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/s0/git-publish-subdir-action/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}