https://github.com/appleboy/gh-pages-action
A GitHub Action to deploy a static site on GitHub Pages.
https://github.com/appleboy/gh-pages-action
actions gh-pages github-actions
Last synced: about 2 months ago
JSON representation
A GitHub Action to deploy a static site on GitHub Pages.
- Host: GitHub
- URL: https://github.com/appleboy/gh-pages-action
- Owner: appleboy
- License: mit
- Created: 2020-03-07T03:22:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-13T03:08:35.000Z (about 4 years ago)
- Last Synced: 2024-04-14T02:55:08.935Z (about 1 year ago)
- Topics: actions, gh-pages, github-actions
- Language: Shell
- Homepage:
- Size: 230 KB
- Stars: 27
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Deploy A Static Site to GitHub Pages - Deploy to custom directory and ignore folder/file. (Community Resources / GitHub Pages)
- fucking-awesome-actions - Deploy A Static Site to GitHub Pages - Deploy to custom directory and ignore folder/file. (Community Resources / GitHub Pages)
- awesome-workflows - Deploy A Static Site to GitHub Pages - Deploy to custom directory and ignore folder/file. (Community Resources / GitHub Pages)
README
# 🚀 GitHub Pages for GitHub Actions
[GitHub Action](https://github.com/features/actions) for deploying a static site on GitHub Pages.

## Usage
Deploying a static site on GitHub Pages.
```yaml
name: Deploy the static file to GitHub Page
on: [push]
jobs:build:
name: Build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1- name: deploy docs
uses: ./
with:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
remote_url: https://github.com/appleboy/gh-pages-action.git
```Please create your own [Personal Access Token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) on GitHub setting page and set the password as access token not your account password.

output:
```sh
D Dockerfile
D LICENSE
D README.md
D action.yml
D docs/index.html
D entrypoint.sh
?? index.html
+ git add .
+ git commit -m commit 6b0497a3b6f0f975c605c28950dbe15dedf4e8f0
Author: Bo-Yi Wu <***[email protected]>
Date: Sat Mar 7 20:25:50 2020 +0800chore: update
[gh-pages f156e8c] commit 6b0497a3b6f0f975c605c28950dbe15dedf4e8f0 Author: Bo-Yi Wu <***[email protected]> Date: Sat Mar 7 20:25:50 2020 +0800
7 files changed, 94 deletions(-)
delete mode 100644 .github/workflows/ci.yml
delete mode 100644 Dockerfile
delete mode 100644 LICENSE
delete mode 100644 README.md
delete mode 100644 action.yml
delete mode 100755 entrypoint.sh
rename docs/index.html => index.html (100%)
+ git push origin HEAD:gh-pages
To https://github.com/***/gh-pages-action.git
bd265c2..f156e8c HEAD -> gh-pages
```## Input variables
See [action.yml](./action.yml) for more detailed information.
* username - github username
* password - github password or [create your personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)
* upstream_name - git upstream to target, default is `origin`
* target_branch - git branch to target, default is `gh-pages`
* temporary_base - temporary directory for pages pull, default is `.tmp`
* pages_directory - directory of content to publish, default is `docs`
* target_directory - directory of content to sync
* exclude - exclude files matching PATTERN
* commit_author - git author name, default is `GitHub Action`
* commit_author_email - git author email, default is `[email protected]`
* remote_url - git remote url
* workspace - git clone path### Example
Deploy to target directory.
```yaml
- name: deploy to target directory
uses: ./
with:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
remote_url: https://github.com/appleboy/gh-pages-action.git
target_directory: 2020
```Custom ignore list you don't want to sync.
```yaml
- name: exclude list
uses: ./
with:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
remote_url: https://github.com/appleboy/gh-pages-action.git
target_directory: ignore
exclude: ignore.html
```custom author email and name:
```yaml
- name: deploy to target directory
uses: ./
with:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
remote_url: https://github.com/appleboy/gh-pages-action.git
commit_author: foo
commit_author_email: [email protected]
target_directory: 2020
```