I would like to use Gitea actions to build and deploy an 11ty site on push, something I do regularly on Github. I noticed that Gitea actions are enabled by default in the YNH Gitea config:
[actions]
ENABLED=true
…which led me to believe that maybe actions were ready to go upon install, but it seems like you need to install and configure a runner first, which I have no idea how to do on YNH.
So my question is: has anyone else managed to get Gitea actions working with yunohost, and if so, how?
I’m working on it, and as a begginner myself i can’t wrap my head around where to install this runner for it being accessible and able to modifiy my files (/var/www/my_webapp permissions to tinker if i want to auto publish my site i guess)
I’ll put a word here if i have a proper way to do so
Edit : So far so good, following this guide i created a gitrunner user (given admin perms), installed from binary inside it’s home folder, registred sucessfully the runner on https://git.myserver.com thanks to the generated key and setted up my systemd service, all i need now is to test this out and i’ll get back to you
The actions feature is controlled from within the app.ini file and it is disabled by default by the Yunohost installer. In order to activate it, you should make some changes to that file. And you also need to provide a runner aka act runner and connect it using a token.
Activate Gitea Actions
Open app.ini file in edit mode. It is located in /var/www/gitea/custom/conf/app.ini.
Locate the [actions] settings and set it true: ENABLED = true.
Restart the Gitea service. You can do it from the Yunohost admin GUI > Tools > Services > Gitea > Restart
Now you should be able to run actions after setting up your runners.
Important
There is a statment at the top of the app.ini file like the following:
WARNING: Don’t edit this file. All change will be removed after each app upgrade
So you are responsible to enable the actions after each Gitea update.
Setup a Runner If You Haven’t Yet
Set up a runner as per documented in the docs. The recommendend and convenient way to do it is to set up docker runners since it is more secure.
You can set it up at 3 different levels:
Instance level
Organization level
Repository level
Choose the level by your convenience and go to the settings page depending on the level you chosen. Find Actions > Runners tab. There you find a button with title Create new Runner, click on it and copy the Registration Token.
Then choose a machine on which you wanna install the runner. It may be a local or server machine.
Make sure the Docker is installed and running on that machine.
Then run the following docker command to install a runner. But first make sure you change the URL, TOKEN and NAME variables as your need:
Then go to your gitea settings page where you have copied the registration token and the runner should appear there as my-runner-1. If not, refresh the page.
That’s basically all you have to do to have a running Gitea actions.