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
on:
workflow_dispatch:
push:
branches:
- 'master'
So far we are just pushing to dockerhub so registry should be docker.io
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
```
on:
workflow_dispatch:
push:
branches:
- 'master'
```
So far we are just pushing to dockerhub so registry should be docker.io
```
- name: Login to Docker Container Registry
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.USERNAME }}
password: ${{ secrets.TOKEN }}
```
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
```
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: luuul/4get:latest
```
@Fijxu thoughts?
So far we are just pushing to dockerhub so registry should be docker.io
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.
not sure if metadata action is needed
It's needed to catalog old and new images generated. Each new image will contain a latest tag and a YYYY.MM.DD-commit_hash on it. When a new commit is pushed, the latest image will be replaced by the latest commit, meanwhile the one with the tag YYYY.MM.DD-commit_hash will be preserved on the registry.
>perhaps only run builds on master branch
I'll change that, oppsie :3!
>So far we are just pushing to dockerhub so registry should be docker.io
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](https://github.com/quay/quay) 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.
>not sure if metadata action is needed
It's needed to catalog old and new images generated. Each new image will contain a `latest` tag and a `YYYY.MM.DD-commit_hash` on it. When a new commit is pushed, the `latest` image will be replaced by the latest commit, meanwhile the one with the tag `YYYY.MM.DD-commit_hash` will be preserved on the registry.
(Ex: https://git.nadeko.net/Fijxu/-/packages/container/invidious/versions)
It's needed to catalog old and new images generated
Oh okay
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.
perhaps reference registry in a secret?
>It's needed to catalog old and new images generated
Oh okay
>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.
perhaps reference registry in a secret?
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.
> perhaps reference registry in a secret?
No, just duplicate this line
```
- name: Login to Docker Container Registry (git.lolcat.ca)
uses: docker/login-action@v3
with:
registry: git.lolcat.ca
username: ${{ secrets.GITEA_USERNAME }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Login to Docker Container Registry (quay.io)
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
```
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'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?
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.
...never used github actions or what git checkout does.
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.
> 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.
> ...never used github actions or what git checkout does.
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
luuulso 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
latesttag and aYYYY.MM.DD-commit_hashon it. When a new commit is pushed, thelatestimage will be replaced by the latest commit, meanwhile the one with the tagYYYY.MM.DD-commit_hashwill be preserved on the registry.(Ex: https://git.nadeko.net/Fijxu/-/packages/container/invidious/versions)
479854d9d7to13dfa9240cOh 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 checkoutdoes.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 checkoutis used to simply switch between branches in the command line.Pull request closed