Creating releases / atefacts / outputs / publishing from CI.
I may be going around this completely the wrong way, hence why I cannot seem to find a solution.
I have Nexus artefact repository set up to take Docker images.
In my pipeline, I build the container in a non-master branch. When I am happy with it, I want to create a PR, which once approved will push to master branch and publish the container image to Nexus.
I am having a hard time getting GitHub workflows to do the build and publish in different “phases”.
I’m aware of GitHub releases, but AFAIK, they don’t support container images. I would need to use a container repo such as docker.io or my own (Nexus).
Half the problem seems to be the
on: statement. It happens at the start of the workflow. Is there a way to have multiple workflows with their own
on: settings? This way the first one can build from non-master branches and the second one can build from master.
To achieve this, one way I am trying is to split my workflow into two jobs:
publish. I’ve set
if: github.event.pull_request.merged on the
publish job but it never triggers. My
on: statement looks like:
on: push: branches: [ develop, master ] pull_request: branches: [ master ]
Even echoing out
github.event.pull_request.merged, never returns anything.
I’m sure this is CI/CD 101, but I can’t get it to work. Any help would be greatly appreciated.