Has anyone managed to get Gitea actions working with yunohost?

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?

1 Like

Hello

Did you found out a way to make it work ?

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 :slight_smile:

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

2 Likes

I haven’t had any luck, no. Thanks! I’m keen to hear how it goes!

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

  1. Open app.ini file in edit mode. It is located in /var/www/gitea/custom/conf/app.ini.
  2. Locate the [actions] settings and set it true: ENABLED = true.
  3. Restart the Gitea service. You can do it from the Yunohost admin GUI > Tools > Services > Gitea > Restart
  4. 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
  1. 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.
  2. Then choose a machine on which you wanna install the runner. It may be a local or server machine.
  3. Make sure the Docker is installed and running on that machine.
  4. 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:
docker run --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-e GITEA_INSTANCE_URL=<your gitea instance url> \
-e GITEA_RUNNER_REGISTRATION_TOKEN=<your registration token> \
-e GITEA_RUNNER_NAME=my-runner-1 \
--name gitea_runner_1 \
-d docker.io/gitea/act_runner:latest
  1. Confirm it is running by issuing docker ps
  2. 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.