hugo-landing-page icon indicating copy to clipboard operation
hugo-landing-page copied to clipboard

Can you add Github Action for deployment on GitHub Pages?

Open kingabzpro opened this issue 3 years ago • 3 comments

I wanted to automate my workflow on gh pages and I have been struggling to use npm run deploy can you tell me what I am doing wrong?

I try to deploy it but the website broke: http://abidaliawan.me/exfinite/

Do let me know what I am doing wrong.

kingabzpro avatar Nov 13 '21 15:11 kingabzpro

Supporting specific configurations and/or deployment workflows is currently out of scope of a template like this, sorry.

These links might help you:

  • https://gohugo.io/hosting-and-deployment/hosting-on-github/
  • https://github.com/marketplace/actions/hugo-setup

ttntm avatar Nov 17 '21 07:11 ttntm

I have used the same guide and I tried everything to get better results and hugo guide dosent work. Well thank you.

kingabzpro avatar Nov 17 '21 07:11 kingabzpro

Deploying to gh-pages using Github actions worked fine for me. Here is my workflow script in case useful:

on: 
  push:
    branches:
      - main
jobs:
  build-and-deploy:
    
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: '0.91.2'      

      - name: Install and Build 
        run: |
          npm install
          npm run deploy
          touch public/.nojekyll

      - name: Deploy
        uses: JamesIves/[email protected]
        with:
          branch: gh-pages # The branch the action should deploy to.
          folder: public # The folder the action should deploy.

jasonmcewen avatar Jan 24 '22 00:01 jasonmcewen