Add actions support for 4get docker image builds #66
Loading…
Reference in New Issue
No description provided.
Delete Branch "Fijxu/4get:4get-actions"
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?
Supersedes #51
no fucking idea what a docker action is
@throwaway what do you make of this
gitea actions is gitea's implementation of github actions which makes it easy to react to changes on a repo such as a new push request,
https://docs.github.com/en/actions/about-github-actions/understanding-github-actions
each step is pulled from https://github.com/actions
for example: job "uses: actions/checkout@v4" will pull and run https://github.com/actions/checkout
with gitea actions you can pull actions from any host, but the default is github
https://docs.gitea.com/usage/actions/faq#where-will-the-runner-download-scripts-when-using-actions-such-as-actionscheckoutv4
you will need to have a runner, which is a program that will run the steps specified in the workflow
https://docs.gitea.com/runner/0.2.11/#run
I haven't used github/gitea actions personally, but I am a big fan of CI/CD. I personally think it's worth it to automate whenever you can. A few changes I'd make:
perhaps only run builds on master branch
So far we are just pushing to dockerhub so registry should be docker.io
lolcat uses the username
luuul
so images would be "luuul/4get" maybe "docker.io/luuul/4get" I am not sure
not sure if metadata action is needed
from https://github.com/docker/build-push-action
it seems you can just push to a tag
@Fijxu thoughts?
I'll change that, oppsie :3!
That's ok. I don't like DockerHub since it's a closed source image registry. It's better to upload the images to the own image registry that Gitea has, but if the git server goes down for some reason, the image will not be available to download.
Quay.io is a good FOSS alternative
That's up to @lolcat, but the action can be modified to upload to two image registries instead of just using one and let the user to decide which registry to use.
It's needed to catalog old and new images generated. Each new image will contain a
latest
tag and aYYYY.MM.DD-commit_hash
on it. When a new commit is pushed, thelatest
image will be replaced by the latest commit, meanwhile the one with the tagYYYY.MM.DD-commit_hash
will be preserved on the registry.(Ex: https://git.nadeko.net/Fijxu/-/packages/container/invidious/versions)
479854d9d7
to13dfa9240c
Oh okay
perhaps reference registry in a secret?
No, just duplicate this line
and so on with the other steps. That should work fine, but I haven't tried that. I'll wait for @lolcat and see what he says about it before trying it.
I'm failing to understand what purpose this has. I never used github actions or what
git checkout
does.From what I'm reading here, it sounds like this generates a new docker image every time I push code? What compiles that code exactly, the gitea server?
I believe you need to install an agent on the server you want to use to compile the code. You can do it on the same server where Gitea is.
I don't think we need to use GitHub Actions, although GitHub's servers are free to use, but you can use your own server instead with Gitea Actions.
git checkout
is used to simply switch between branches in the command line.Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.