Skip to content

Instantly share code, notes, and snippets.

@MarkWarneke
Created July 1, 2020 13:28
Show Gist options
  • Select an option

  • Save MarkWarneke/bde5eddaa81d5b5eac93ebf80e864976 to your computer and use it in GitHub Desktop.

Select an option

Save MarkWarneke/bde5eddaa81d5b5eac93ebf80e864976 to your computer and use it in GitHub Desktop.
Gist to publish docs branch as Github pages. By CompositionalIT/farmer
name: gh-pages
on:
push:
branches: [ docs ]
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- name: Checkout docs branch
uses: actions/checkout@v2
with:
ref: docs # Pull the docs branch
submodules: true # Fetch Hugo themes as well (they're in sub-modules)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.68.3'
- name: Build # Builds using hugo; outputs to ./public by default
run: hugo --minify
- name: Deploy # Pushes output of the build to the GH Pages branch
uses: peaceiris/actions-gh-pages@v3
with:
commit_message: ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
@MarkWarneke
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment