Add actions support for 4get docker image builds #51
Loading…
Reference in New Issue
No description provided.
Delete Branch "ckg/4get:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This automates the process of having to build a docker image and upload it to the registry (hub.docker.com).
It builds the docker image and it uploads it to
git.lolcat.ca
docker registry. You can change this to other registry likequay.io
.You will need to setup a
runner
in any server you have so it's able to fetch new commits, build the image and then upload it to the server. Without a runner, the job will never run.I'll leave a small tutorial down here so you can setup a runner on the server:
docker
group (make sure to relogin after adding the user to the group)5.x.x
, it's broken) (and rename it toforgejo-runner
xd, you can leave it inside /usr/bin if you want)forgejo-runner register
, get the registration token from https://git.lolcat.ca/user/settings/actions/runners and set the label to:docker:docker://ghcr.io/catthehacker/ubuntu:act-22.04
forgejo-runner daemon &
(you can use tmux, a systemd service, whatever)USERNAME
with your gitea username (lolcat
) and a secret with nameTOKEN
, you can get the token using https://git.lolcat.ca/user/settings/applications; set a name for it, and set permissionsrepository: read; package: read and write
Every time you modify the source code, it will build a new image under
git.lolcat.ca/lolcat/4get:latest
, every version is going to be tagged with the date and the commit.https://git.lolcat.ca/ckg/-/packages/container/4get/2024.11.26-1545e91
1545e91805
to91a792d169
That's awesome bro, but all of this docker shit went over my head. What pushes the docker image? My machine doing
git push
or git itself?For 5 year olds:
forgejo-runner
calls Docker to buildDockerfile
, it waits until it's finishes and then the image is pushed to the "docker registry" which isgit.lolcat.ca
You can run
forgejo-runner
on any machine.Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.