I am a full-stack developer and love coding and tooling. At my work, I am often the person who is developing and setting up dev and production environments.
I knew I can do better than what I have! I very recently got into githubworkflows, I am not used to using premade jobs. In my company we use gitlab for our workflow and there you usually code it yourself. But I definitly gonna check the repositories out!
I already had a look into your workflow file. I must admit I find my solution more readable. I miss YAML Anchors so I can make it even more readable.
But I want to improve it and condense it to one file and yes currently I am just deplying to one registry, but this might change!
If you are hoping to condense the 2 workflows into one, you can probably use a conditional step that checks which event triggered that run. For example:
- if: ${{ github.event_name == 'push' }}run:# thing you want to do on a push
And then something similar for the schedule event.
I am a full-stack developer and love coding and tooling. At my work, I am often the person who is developing and setting up dev and production environments.
Your workflow is very readable. The step I named prepare is almost certainly more complicated than it needs to be. It is getting the release tag from the github release that triggered the workflow, and generating a list of tags for the image. From a github release tag of let's say v3.2.1, I'm dropping the v and tagging the docker image with: latest, 3.2.1, 3.2, and 3 (the step that does all of that looks very messy).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey thank you for your feedback!
I knew I can do better than what I have! I very recently got into githubworkflows, I am not used to using premade jobs. In my company we use gitlab for our workflow and there you usually code it yourself. But I definitly gonna check the repositories out!
I already had a look into your workflow file. I must admit I find my solution more readable. I miss YAML Anchors so I can make it even more readable.
But I want to improve it and condense it to one file and yes currently I am just deplying to one registry, but this might change!
If you are hoping to condense the 2 workflows into one, you can probably use a conditional step that checks which event triggered that run. For example:
And then something similar for the schedule event.
I thought of doing it in a similar way! :D But it didn't work yet. I will revisit this next week.
Your workflow is very readable. The step I named prepare is almost certainly more complicated than it needs to be. It is getting the release tag from the github release that triggered the workflow, and generating a list of tags for the image. From a github release tag of let's say v3.2.1, I'm dropping the v and tagging the docker image with: latest, 3.2.1, 3.2, and 3 (the step that does all of that looks very messy).