Skip to content

Instantly share code, notes, and snippets.

@aneesahammed
Created April 15, 2021 12:25
Show Gist options
  • Save aneesahammed/dcca74cc159e5b051a68b7797d5a51a9 to your computer and use it in GitHub Desktop.
Save aneesahammed/dcca74cc159e5b051a68b7797d5a51a9 to your computer and use it in GitHub Desktop.
GitHub Action file to deploy Hugo
# This is a basic workflow to help you get started with Actions
name: Deploy
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: master
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "deploy"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Github Actions fo Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.81.0"
# Creates ./public directory
- name: Build
run: hugo --minify
# Upload/Commit the contents from publish_dir -> external_repository
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
external_repository: aneesahammed/aneesahammed.github.io
publish_branch: master
personal_token: ${{secrets.GH_TOKEN}}
user_name: aneesahammed
user_email: [email protected]
publish_dir: ./public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment