name: Hugo Deploy
on: push
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Update theme
# (Optional)If you have the theme added as submodule, you can pull it and use the most updated version
run: git submodule update --init --recursive
- name: Setup hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.117.0"
- name: Build
# remove --minify tag if you do not need it
# docs: https://gohugo.io/hugo-pipes/minification/
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.APP_TOKEN }}
external_repository: github-username/github-repository
# publish_dir: ./docs
# keep_files: true
user_name: username
user_email: example@example.com
publish_branch: gh-pages
# cname: example.com
Correct. Never work in branch gh-pages only in sub-branches that want to merge in the main branch and the workflow must pushed in the main-branch in .github/workflows as main.yml
And I’ve forgotten to write. You need an app_token. this you can create in Settings > Developer settings > Personal access tokens (classic)
Here you need to create a new repository token ( Generate new token (classic) )
This token you must copy and integrate in your repository.