benmatselby / hugo-deploy-gh-pages Goto Github PK
View Code? Open in Web Editor NEW๐ฆ A GitHub Action to build and deploy a Hugo site to GitHub Pages
License: MIT License
๐ฆ A GitHub Action to build and deploy a Hugo site to GitHub Pages
License: MIT License
Hi @benmatselby kindly let me know when are you going to release the 0.6 version
I can help by creating a similar documentation like how jwright wrote it :)
Thank you
I met this method of auto-publishing a few months ago and, back then, I tested it with a makeshift project using the most basic theme I've found on the Internet.
Then I kept on my project, developing my own theme 'til today, release day, the action failed several times in a row pointing me with the error /usr/bin/action.sh: line 83: cd: public: No such file or directory
right after Hugo's compilation summary (number of pages, static files, time taken...)
I've tested many possibilities to fix this without understanding why the test repository worked and the real one didn't, 'til I decided to comment out the publishDir
entry in my config.yaml
that was pointing to ../some-other-folder
used while developing with Hugo Server.
I don't know if you can make the Action workaround it, maybe creating a virtual copy of the config.yaml
in the repository and manually removing that entry, who knows, I'm just posting here so anyone else in trouble has some info on how to fix that.
Thank you for your work :D
Does the target repository always a username?
What if I want to deploy my hugo pages in a project deployment rather than personal blog
To avoid getting infinity loop between the publishing to master and deploying the github pages because there is a master branch push
In VS Code I am getting the following warning:
Missing required inputs: `github_token`, `hugo_version`, `target_repo`
These have been replaced by corresponding environment variables, but action.yml still has them as required inputs.
Hi,
I've been using this action for a while, following the Tutorial. But after updating to a newer version of Wowchemy, I'm getting this error:
Error: failed to download modules: exec: "go": executable file not found in $PATH
I tried to install go in many different ways, for instance:
- name: setup go
uses: actions/setup-go@v1
with:
go-version: 1.16.x
But the error persists.
Do you have any idea about how to solve it?
When trying to deploy the current academic-kickstart repo, the action fails with an error that seems to indicate that Hugo Extended is required:
Error: Error building site: TOCSS: failed to transform "main_parsed.scss" (text/x-scss): resource "scss/scss/main.scss_6c95cc1249b26b124274204dbf970c34" not found in file cache
[...]
According to this issue, Hugo Extended does seem to be a prerequisite. However, in the current version of this action there does not seem to be a way to specify that Hugo Extended should be used.
Refer to your code
https://github.com/benmatselby/hugo-deploy-gh-pages/blob/master/action.sh#L52
When I add new post or new image and run hugo
, new file generated to public/, but it is not existed in target_repo(build/), so git diff --exist-code
can not diff anything and exit with 0.
In my opinion, don't clone the target_repo, directly run
cd ${GITHUB_WORKSPACK}
hugo
rm -rf .git
cd public
git init
git add .
git commit -m 'Auto build'
git remote add origin $TARGET_REPO
git push -f origin master
if nothing to commit, git will exit itself. and the code in public has not worthy to keep in git
Hello,
the action started to fail recently for one of our repos.
Building the Hugo site with: 'hugo '
Start building sites โฆ
hugo v0.98.0-...
ERROR 2022/12/20 10:14:35 Failed to read Git log: fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:
git config --global --add safe.directory /github/workspace
Error: Error building site: logged 1 error(s)
I tried to reproduce it locally by checking out the code the way GitHub does and then running your action in a container as described in the README, but I haven't been successful so I don't have a clear reproducer for you.
But if you fork https://github.com/packit/status the https://github.com/packit/status/blob/main/.github/workflows/deploy-pages.yml should fail for you as well - if you change it to use your action instead of my fork and remove the if:
condition.
I have been able to workaround the problem exactly the way the error message suggests, i.e. by adding
"git config --global --add safe.directory ${PWD}" to the action.sh
.
See actions/checkout#766 for more info.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.