Skip to content

Commit

Permalink
Publish to github pages through workflow on push
Browse files Browse the repository at this point in the history
  • Loading branch information
daemon1024 committed Sep 11, 2021
1 parent f2b763d commit 3ee7e6b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: github pages

on:
push:
branches:
- main # Set a branch to deploy

jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Hugo setup
uses: peaceiris/[email protected]

with:
hugo-version: 'latest'
extended: true

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build
run: hugo --minify

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

0 comments on commit 3ee7e6b

Please sign in to comment.