Despite using GitHub almost every day I've no real experience with GitHub actions, but this year I'm trying use each of the Dev hackathons to expand my skills and understanding of new technologies.
I decided once again to base this around Eleventy as it's a tool I'm using a lot at the moment and I love giving back and contributing to this community where I can.
The action I'm building will allow users to create a new, blank Eleventy site including all the files and directories I usually use/create when creating a new site:
.eleventyignoreto ignore the
.eleventy.jsto change the build dir to
docsfor GitHub pages.
.gitignore- it'll get used eventually!
_assetsdirectory for design files
partialsdirectory for Sass partial files (these are then compiled into the
I had a look at the documentation and created a pretty basic workflow file using the template provided. I then set about creating the new site with a series of simple
All looked good - let's run it and see what happens.
mkdir: missing operand.
Well, that was to be expected. Easy fix, I just removed the
mkdir part of the script - we don't actually need this anyway as we need the
docs directory we're creating to be in the root of the branch.
ERROR - Process completed with exit code 128.
This one was a little more complicated. I'd tried to run git commands to add the new site to the repo - but it needed to validate who the user is (obviously). I did some research and came across an existing action that can help here.
I added this to my workflow, hardcoded my details for now, and ran the action again.
No errors thrown on this run... but when I check the repo, there's been no files created or added. More work needed.