Giter Site home page Giter Site logo

apollonbar / github-actions-hexo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yrpang/github-actions-hexo

0.0 0.0 0.0 17 KB

A Github action used to automatic generate publish hexo-based blog and clear Cloudflare cache.

License: MIT License

Dockerfile 20.51% Shell 79.49%

github-actions-hexo's Introduction

Github Action for Hexo

The GitHub Actions for automatic generate and deploy hexo-based blog.

Features:

  • Update source files after hexo g

  • Clean CloudFlare cached after deploy(Only support CloudFlare Token. For more you can try Cloudflare Purge Cache)

Usage

Before using this action, please config hexo env locally and install hexo-deployer-git plugin. The official reference documentation of the plugin is https://hexo.io/docs/one-command-deployment#Git

e.g.

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment#Git
deploy:
  type: git
  repo: [email protected]:yrpang/yrpang.github.io.git
  branch: master

Prepare

  • Apply a DEPLOY_KEY for the repository of your GitHub Page

  • (Use Cloudflare Only)Apply a CLOUDFLARE_API_KEY

Example Workflow file

name: Hexo Build and Deploy

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Cache node modules
        uses: actions/cache@v1
        with:
          path: node_modules
          key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}}
      - uses: yrpang/github-actions-hexo@master
        with:
          deploykey: ${{secrets.DEPLOY_KEY}}
          username: YOUR_USER_NAME
          email: YOUR_EMAIL_ADDRESS

Inputs

Name Type Required Default Description
deploykey secrets Yes The deploy key of your GitHub Page repository
username string Yes Your user name
email string Yes Your email address
if_update_files boolean false Whether update the source file after generate
github_token secrets Token for the repo. Can be passed in using ${{ secrets.GITHUB_TOKEN }}
branch string 'master' The branch of the blog source code
if_update_cloudflare boolean false Whether update cloudflare
cloudflare_zone string the cloudflare zone
cloudflare_token secrets Your cloudflare token

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

No affiliation with GitHub Inc.

GitHub are registered trademarks of GitHub, Inc. GitHub name used in this project are for identification purposes only. The project is not associated in any way with GitHub Inc. and is not an official solution of GitHub Inc. It was made available in order to facilitate the use of the site GitHub.

github-actions-hexo's People

Contributors

apollonbar avatar fabiofdsantos avatar yrpang 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.