Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/tag image action #47

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

simonhir
Copy link
Member

Description

Add action for tagging a existing image.

Example run: https://github.com/it-at-m/refarch/actions/runs/11554187044

@simonhir simonhir requested a review from hupling October 28, 2024 12:54
@simonhir simonhir self-assigned this Oct 28, 2024
description: "Image registry to push image to"
required: true
default: ghcr.io
registry-username:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we provide the value of github.actor as a default here? Or isnt this possible?

registry-username:
description: "Username to authenticate against image registry"
required: true
registry-password:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we provide the value of secrets.GITHUB_TOKEN as a default here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually secrets need to provided seperatally. there is an extra section

required: true
new-tag:
description: 'New tag'
required: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we provide "latest" as a default value here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion that is a too specific behavior for a action so i explicitly didn't set it.

.github/actions/action-tag-image/action.yaml Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to add another layer of abstraction by providing a reusable workflow with a workflow_call trigger and then simplify the actual workflow template even more by just triggering the reusable workflow? See the other workflows for reference.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nearly every call from the templates is direct to the actions.
Also i see no real advantage in that, when correctly versioning this repository, while introducing additional complexity.

@hupling
Copy link
Collaborator

hupling commented Oct 28, 2024

i don't understand why you need this. you already create a release Version with a release. 1.0, 1.1 then you dont need to tag

@hupling
Copy link
Collaborator

hupling commented Oct 28, 2024

@it-at-m/sps whtat's your opinion

@simonhir
Copy link
Member Author

simonhir commented Oct 28, 2024

i don't understand why you need this

For me it would be ok to not add it to .github. I just created this for myself in refarch and thought it could be useful for others.
The use case for implementing it is to move the latest tag if a released image has a bug, but that could probably be resolved somehow different. Also this would allow to tag a image with RC prefix and later use it as stable image

@hupling
Copy link
Collaborator

hupling commented Oct 28, 2024

Actually I had it here https://github.com/it-at-m/sps-backend/blob/test-neu/.github/workflows/tag-image.yaml

I think if there is a error you need to do a new release. The image is immutable.
You need to delete the Git Tag, release notes, etc. If you make a rerelease.

For example there was an error in the gitlab runner 15.5.0. So I needed to install version 15.5.2 with the bugfix. The image 15.5.0 is always immutable

@simonhir
Copy link
Member Author

simonhir commented Oct 29, 2024

The image is immutable.

Actually it was your suggestion to delete broken images?
Which also makes sense in my opinion and to delete a broken latest image if the fix takes some time, you need to move the latest tag.

@ejcsid
Copy link

ejcsid commented Oct 30, 2024

The image is immutable

That's true. But the image tag isn't. I think it's ok to just re-tag "latest" (or any other tag) to another image if necessary. But: I'm not sure if we should provide it within the templates. It may be misunderstanding. May be better to document how re-tag could be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants