DiamondLightSource / python3-pip-skeleton

Archived in favour of https://github.com/DiamondLightSource/python-copier-template
Apache License 2.0
4 stars 4 forks source link

Improve container build workflow #139

Closed AlexanderWells-diamond closed 1 year ago

AlexanderWells-diamond commented 1 year ago

This will test the container before it is pushed to GHCR

Note the second docker/build-push-action may look like it is building the image again, but it seems to require all that configuration in order to locate the previously cached image. When looking at the logs it shows it is using the CACHED version.

I also added the target:runtime optional parameter, as otherwise we were relying on the format of the Dockerfile - by default it uses the last target in the file.

The only question I have is whether it is worthwhile adding some additional/example configuration for doing other things with the tags/labels. For a project that uses the Skeleton I want to publish a container with every commit from a particular branch with its own tag (and NOT use latest). I don't know if this will be too complicated to include in examples as I haven't done it yet.

Fixes #138

codecov[bot] commented 1 year ago

Codecov Report

Merging #139 (ef0af86) into main (64d2a03) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##              main      #139   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           16        16           
=========================================
  Hits            16        16           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

gilesknap commented 1 year ago

@AlexanderWells-diamond were you able to test this in your personal GitHub space by forking? I'm asking because of a permissions issue we have been seeing with gh-pages and forks.

AlexanderWells-diamond commented 1 year ago

I did indeed test this in my personal fork, here: https://github.com/AlexanderWells-diamond/python3-pip-skeleton

All of the Docs CI builds fail due to permissions issues on the token. As they're immaterial to this PR I ignored them.

gilesknap commented 1 year ago

All looks good. I have tested here https://github.com/epics-containers/ibek/actions/runs/5121027887

Thanks Alex.

Merging ...