Closed sosedoff closed 1 year ago
yeah this feels a bit fragile cause it will not necessarily push the right code to docker, relies on a certain amount of luck.
Would far prefer is the flow is:
let me ping @davidtaylorhq and @CvX unless they have any ideas off top of head here. I want to make sure that anything we are pushing to docker is a reproducible build
Would far prefer is the flow is: I noticed a new tag
This is the logic that publish-rubygems uses for the version tagging and release:
Perhaps we could add a boolean output to that publish-rubygems action like "did_publish". Then the Docker image publishing job could be configured like:
needs: publish
if: ${{ needs.publish.outputs.did_publish }}
What do you think @cvx?
Yeah, extra output from the publish action sounds good!
We could also use the existing output new_version
(https://github.com/discourse/publish-rubygems-action/blob/b89928239fc68d769527dd092b093b70c0e8a969/entrypoint.sh#L23) . Basically, we run the docker image publishing job if the gem publishing job was successful and new_version
is true.
@SamSaffron take a look. The mode to the gem publisher step has been implemented here https://github.com/discourse/publish-rubygems-action/pull/9, and latest PR commit addresses these modifications.
Workflow in #267 is broken due to how Github handles workflows triggered from within another workflow:
I moved the publishing job into the same CI/CD workflow, it'll kick in once the gem publishing job is complete. It should work the same as the original
docker.yaml
flow, except the version will come from the actual ruby file. The only downside with this approach is that target docker images will be overwritten on pushes to master even if the gem version has not changed. Maybe we could check if image exists by pulling it first, i need to test this path to be sure.Alternatively, we could use the existing setup and generate a new Github API token for the
discoursebot
user, that way it'll be able to schedule a run when a new tag is pushed viarake release
(in the gem publish step). But i know nothing about the bot and how it's being used in other projects, if any, so such approach might not be feasible.WDYT?
(ALSO: I'd like to do a E2E test with a fake account to make sure this really works before we merge).