Deploy to Neocities Action via Forgejo

Hello, I’m remaking my site using 11ty and thought to start using the Deploy to Neocities workflow. I’m using the Forgejo instance and I just can’t get the action to work properly.

The action is stuck on runs on: ubuntu-latest and I found that unlike Github, Forgejo doesn’t have any runners. They need to be installed (guide).

My question then is, there is a sane way to use Actions on Forgejo or should I just mirror my repo to Github and trigger the workflow there?

Link to the repo: ArimaMary/ArimaMary-V2: Second version of my main site - 32-Bit Cafe Git: Beyond coding. We Forge.

I know this doesn’t answer your question, but what if you implemented a post-commit hook that built your site and deployed it on your own machine?

I really ought to do that myself, to be honest, instead of manually calling make from my terminal or in Emacs. =^..^=

Omg I’ve been waiting for this solution T_T it’s the only reason I didn’t wanna move from github

Forgejo actions requires us to set up runner infrastructure on the backend, which we have not done. It may be something we offer in the future but there are not plans to do so right now. Your best bet is to mirror to another git server which offers runners

Do you have a guide to do any of that? I’ve never used hooks nor deployed anything to my machine.

Really appreciate this alternative!

Thank you for answering my question! Will do :saluting_face:

Hi, @ArimaMary. Sorry about the delay in my reply, but I didn’t want to say I didn’t have a guide.

So I wrote my own, based on my own experiences implementing hooks this afternoon. I hope this proves useful.

Thank you so much for going through the trouble! I tried following the guide and I got stuck on Step 3. I managed to " open an empty file called post-commit inside the .githooks directory." I typed the script both by copying the code (the lines with the numbers and the command at the beginning) but nothing happened after typing bash .githooks/post-commit under it. I’m using Git Bash on Windows.

I also tried typing that command on another terminal window but it sent a message that the .githooks directory was empty.

Were you still inside the .githooks directory when you tried to run the post-commit script?

When I typed the bash .githooks/post-commit on another terminal window? Probably, now that you mention it. I don’t know how to move across directories using the terminal without a guide after all.

@ArimaMary, here are some basics to help you along when using Git bash:

  • type pwd to see where you currently are.
  • type cd <directory-name> to change to that directory.
  • type cd .. to move up to the directory that contains the current directory.
  • type ls -Al to see what’s in the current directory.

If pwd shows that you’re in .githooks, then try typing bash ./post-commit to test it. In a path like ./post-commit, the dot and then the slash tell the shell to look for that file in the current directory.

Hopefully this gets you unstuck. I probably should have asked about your experience level before I started writing this tutorial. Sorry about that.

Testing guide on a whole new directory. I used the terminal to create the directory website and followed the guide back to step 3. With the terminal, I managed to reach .githooks directory before opening another bash terminal, copying the script, and editing it a little such as replacing the project’s path and removing the numbers on each line of the code (not sure if I was supposed to do this).

I have the script on a terminal using bash and in another one, I managed to reach the .githooks directory.

Typing bash ./post-commit on the latter terminal gives me the message bash: ./post-commit: No such file or directory. Similarly, typing ls -Al gives me the response total 0 which I assume means there’s no file in the .githooks directory.

Attaching screenshots with contents of both terminals.


You’re already in .githooks, so you’re in the same directory as the post-commit script.

Understood, although I’m not sure what I’m supposed with that information tho. Still can’t test the script.

Yes, you can, @ArimaMary. Being in the same directory means you should try bash ./post-commit. As I had mentioned before ./ means “look for the file in the current directory”.