53

I've been trying to figure this part out for a few days. I have my own Forgejo instance and a website each running in separate containers on a Raspberry Pi. I also have the forgejo runner installed in another docker container. I followed some guides to set up forgejo actions, but all the guides end with a simple example that basically just runs the "ls" command.

I tried running 'docker compose up' inside my workflow, but it fails with "docker: command not found". So how do you use the workflow to actually update the website in the other container?

I think I'd prefer keeping everything in docker but I'd be okay with making the workflow run some script on the host machine if needed.

you are viewing a single comment's thread
view the rest of the comments
[-] possiblylinux127@lemmy.zip 5 points 3 days ago* (last edited 3 days ago)

First make make a script that deploys it. Then convert that script into a workflow. In the end your workflow will be 3 steps:

  1. Checkout the repo
  2. Create SSH key
  3. Copy to host and restart service

For the SSH key I would encode it via base64 before storing it as a forgejo secret. You can do via something like this:

cat private.key | base64 -w 0

And then in your workflow

echo $APP_SSH_KEY | base64 -d > ~/.ssh/id_ed25519 (assuming you use ed25519 which is the default key)

I would also advise moving away from docker in favor of podman since docker uses root by default

Another approach could be pushing to the forgejo container registry and then setting your docker host to auto update

[-] myrmidex@belgae.social 3 points 3 days ago* (last edited 3 days ago)

pushing to the forgejo container registry and then setting your docker host to auto update

This is what I prefer, with version tags instead of latest. Then I update the tag manually in the compose file and redeploy, but that could indeed easily be :latest+watchtower, full auto.

this post was submitted on 18 Nov 2026
53 points (100.0% liked)

Selfhosted

63971 readers
1430 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS