aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
411 stars 184 forks source link

CI: Run Docker workflow only for pushes to origin #6446

Closed danielhollas closed 3 weeks ago

danielhollas commented 3 weeks ago

This workflow needs permissions to publish images to ghcr.io, so it does not work for forks. Therefore, let's only trigger it on pushes to aiidateam/aiida-core repo.

I have an idea on how to support forks, basically just running the build and testing it in a single workflow without a push to ghcr.io. But that will be cleaner as a completely separate worfkflow. I'll submit a follow-up PR for that.

unkcpz commented 3 weeks ago

I have an idea on how to support forks, basically just running the build and testing it in a single workflow without a push to ghcr.io.

As I mentioned, you can always use pull_request_target, it allow CI to use GITHUB_TOKEN from forked PR.

danielhollas commented 3 weeks ago

Hmm, this change broke tagging and publishing to ghcr.io. looking into it.

danielhollas commented 3 weeks ago

@sphuber this is now ready. There is one functional change here regarding tagging. Since we run on push event, images on ghcr.io will not be tagged with a PR number, but by a branch name.

So if you push a branch docker-build-refactor to aiidateam/aiida-core origin, you can download the image as docker pull ghcr.io/aiidateam/aiida-core-base:docker-build-refactor.

CC @unkcpz