Home

Awesome

🚀 GitHub Pages for GitHub Actions

GitHub Action for deploying a static site on GitHub Pages.

Deploy the static file to GitHub Page

Usage

Deploying a static site on GitHub Pages.

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 on GitHub setting page and set the password as access token not your account password.

token

output:

 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 <***.tw@gmail.com>
Date:   Sat Mar 7 20:25:50 2020 +0800

    chore: update

[gh-pages f156e8c] commit 6b0497a3b6f0f975c605c28950dbe15dedf4e8f0 Author: Bo-Yi Wu <***.tw@gmail.com> 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 for more detailed information.

Example

Deploy to target directory.

- 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.

- 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:

- 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: bar@foobar.com
    target_directory: 2020