Skip to content

hexo博客进行action化部署.附带CNAME可选项

License

Notifications You must be signed in to change notification settings

chengzhangHu/hexo-deploy-action-with-cname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hexo Deploy Action

针对原有action无法进行CNAME操作进行整改.确保可用

This GitHub action will handle the building and deploying process of hexo project with CNAME enabled.

Getting Started

You can view an example of this below.

name: Build and Deploy
on: [push]
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@master

    - name: Build and Deploy
      uses: Forest10/hexo-deploy-action-with-cname@master
      env:
        USER_NAME: Forest10 # optional
        EMAIL: [email protected] # optional
        CNAME: blog.github.com # optional
        PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        PUBLISH_REPOSITORY: Forest10/forest10.github.io # The repository the action should deploy to.
        BRANCH: master  # The branch the action should deploy to.
        PUBLISH_DIR: ./public # The folder the action should deploy.

if you want to make the workflow only triggers on push events to specific branches, you can like this:

on:
  push:	
    branches:	
      - master

Configuration

The env portion of the workflow must be configured before the action will work. You can add these in the env section found in the examples above. Any secrets must be referenced using the bracket syntax and stored in the GitHub repositories Settings/Secrets menu. You can learn more about setting environment variables with GitHub actions here.

Below you'll find a description of what each option does.

Key Value Information Type Required
PERSONAL_TOKEN Depending on the repository permissions you may need to provide the action with a GitHub Personal Access Token in order to deploy. You can learn more about how to generate one here. This should be stored as a secret. secrets Yes
PUBLISH_REPOSITORY The repository the action should deploy to. for example Forest10/forest10.github.io env Yes
BRANCH The branch the action should deploy to. for example master env Yes
PUBLISH_DIR The folder the action should deploy. for example ./public env Yes

About

hexo博客进行action化部署.附带CNAME可选项

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages