name:GitHub Pageson:push:branches:- main # Set a branch to deploypull_request:jobs:deploy:runs-on:ubuntu-20.04concurrency:group:${{ github.workflow }}-${{ github.ref }}steps:- uses:actions/checkout@v2with:submodules:true# Fetch Hugo themes (true OR recursive)fetch-depth:0# Fetch all history for .GitInfo and .Lastmod- name:Setup Hugouses:peaceiris/actions-hugo@v2with:hugo-version:'0.89.4'extended:true- name:Buildrun:hugo --minify- name:Deployuses:peaceiris/actions-gh-pages@v3if:${{ github.ref == 'refs/heads/main' }}with:deploy_key:${{ secrets.ACTIONS_DEPLOY_KEY }}external_repository:sunnyh1220/posts # github usernamepublish_branch:gh-pagespublish_dir:./public
# This is a basic workflow to help you get started with Actionsname:Blog CI# Controls when the action will run. on:# Triggers the workflow on push or pull request events but only for the master branchpush:branches:[master ]# Allows you to run this workflow manually from the Actions tabworkflow_dispatch:# A workflow run is made up of one or more jobs that can run sequentially or in paralleljobs:# This workflow contains a single job called "build"build:# The type of runner that the job will run onruns-on:ubuntu-latest# Steps represent a sequence of tasks that will be executed as part of the jobsteps:# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it- uses:actions/checkout@v2# Runs a set of commands using the runners shell- name:Blog buildingrun:| yarn install
yarn docs:build
- name:Blog Deployuses:peaceiris/actions-gh-pages@v2.5.1env:ACTIONS_DEPLOY_KEY:${{ secrets.ACTIONS_DEPLOY_KEY }}EXTERNAL_REPOSITORY:sunnyh1220/posts# github deploy repository, PUBLISH_BRANCH:gh-pages# deploy branchPUBLISH_DIR:docs/.vuepress/dist