Skip to content

Instantly share code, notes, and snippets.

@jdheyburn
Last active February 23, 2020 11:15
Show Gist options
  • Save jdheyburn/b4b2cad15604de30f21ad0e1a85ee6b9 to your computer and use it in GitHub Desktop.
Save jdheyburn/b4b2cad15604de30f21ad0e1a85ee6b9 to your computer and use it in GitHub Desktop.
name: Build and deploy to jdheyburn.github.io
on:
push:
branches:
- master
schedule:
- cron: "0 10 * * *"
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.58.3"
extended: true
- name: Build
run: hugo --gc --minify
- name: Copy CNAME
run: cp CNAME ./public/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.DEPLOY_KEY }}
external_repository: jdheyburn/jdheyburn.github.io
publish_branch: master
publish_dir: ./public
commit_message: ${{ github.event.head_commit.message }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment