I am trying to get a public github page from a private source repo following this tutorial which utilizes PUBLIC and PRIVATE key variables from ssh-keygen -t rsa -b 4096 -C "$(git config user.email)" -f deployment -N ""
I have the same setup as described in the link, but I am not able to wrap my head around what is actually not working.
By using the same GitHub action
name: Github Pages
on:
push:
branches:
- main
pull_request:
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.83.0'
- name: Build
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.PRIVATE_KEY }}
external_repository: <username/username.github.io>
publish_dir: ./public
It does not build because
Error: Unable to locate config file or config directory. Perhaps you need to create a new site.Run `hugo help new` for details.
Then I replaced the entire workflow with the one suggested by [Hugo] (https://gohugo.io/hosting-and-deployment/hosting-on-github/) which is much more recent. I then added to the last deployment action
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
with:
deploy_key: ${{ secrets.PRIVATE_KEY }}
external_repository: <username/username.github.io>
publish_dir: ./public
which fails with
Error: Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the `enablement` parameter for this action. Error: HttpError: Not Found
I have set up both deploy keys and private keys as well as the urls seems to be correct and in the public repo I have the following setup for pages
Deploy from branch, brain main and /root. In the previous tutorial they mention a gh-page source but it is not available (I have nothing else beside main). Should there be an additional branch?
Sorry for the long post and thanks for any help!