8000 GitHub - chihqiang/gh-pages-action: A GitHub Action to publish a specified directory to a target Git branch (e.g., `gh-pages`), with optional CNAME support.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A GitHub Action to publish a specified directory to a target Git branch (e.g., `gh-pages`), with optional CNAME support.

License

Notifications You must be signed in to change notification settings

chihqiang/gh-pages-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Publish to Git Branch

A GitHub Action to publish a specified directory to a target Git branch (e.g., gh-pages), with optional CNAME support.


Features

  • Publish the contents of a local directory (e.g., dist) to a specified branch, ideal for deploying static sites.
  • Customize the commit message.
  • Optionally create a CNAME file for custom domain support.
  • Specify the target repository (defaults to the current repository).
  • Uses a token for HTTPS authentication.

Usage Example

- name: Publish to gh-pages branch
  uses: chihqiang/gh-pages-action@main
  with:
    publish_dir: dist
    target_branch: gh-pages
    commit_message: 'Deploy Static Site to Github gh-pages Branch'
    cname: example.com
    repository: user/repo  # Optional, defaults to current repo
    token: ${{ secrets.GITHUB_TOKEN }}  # Required, authentication token

Inputs

Input Required Default Description
token ✅ Yes Token for HTTPS authentication, usually ${{ secrets.GITHUB_TOKEN }}
publish_dir ✅ Yes The local directory to publish (e.g., dist)
target_branch ❌ No gh-pages The branch to publish to
commit_message ❌ No 🔄 update commit: 12345 Commit message for the push
cname ❌ No Custom domain for a CNAME file
repository ❌ No Current repository (GITHUB_RE 5D5A POSITORY) The repo to push to, e.g., user/repo

Notes

  • Ensure the token has permission to push to the repository.
  • If repository is not set, the action pushes to the current repository.
  • The cname input is used to create a CNAME file for custom domains.

About

A GitHub Action to publish a specified directory to a target Git branch (e.g., `gh-pages`), with optional CNAME support.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0