GitHub Action for building and publishing Hugo-built site.
Inspired by khanhicetea/gh-actions-hugo-deploy-gh-pages
This GitHub Action allows you to deploy your Hugo git repo into another one.
GIT_DEPLOY_KEY
- Required your deploy key which has Write access
- Generate deploy key
ssh-keygen -t rsa -f hugo -q -N ""
- Then go to "Settings > Deploy Keys" of repository
- Add your public key within "Allow write access" option.
- Copy your private deploy key to
GIT_DEPLOY_KEY
secret in "Settings > Secrets"
HUGO_VERSION
: optional, default is 0.54.0 - check all versions hereWEBSITE_GIT
: required, the website git repo which you want to deployWEBSITE_DIR
: required, the directory which your website git repo will clone into
name: Deploy to GitHub Pages
on:
push:
branches:
- master
jobs:
hugo-deploy-gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: hugo-deploy-gh-pages
uses: linuxsuren/surenpi@master
env:
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
HUGO_VERSION: "0.53"
WEBSITE_GIT: "[email protected]:LinuxSuRen/linuxsuren.github.io.git"
WEBSITE_DIR: "linuxsuren.github.io"